IBM Support

IJ08181: INCORRECT EVALUATION OF DEFAULT TEMPLATE PARAMETER

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A template default parameter is not found by the compiler.  The
    default parameter is dependant on the first template type in the
    template parameter list, which is itself a typedef.
    
    
       === TEST CASE ===
    
    template <class LIST,
              int NUMBER = LIST::LENGTH>
    struct TypeListTypeOf {
        typedef int Type;
    };
    
    template <typename A1>
    struct TypeList {
        enum { LENGTH = 1 };
    };
    
    typedef TypeList<double> List;
    
    template <typename ARG>
    struct OffsetOf {
        typedef TypeListTypeOf<List>::Type Type;
           // 'List'is a TypeList, containing the LENGTH declaration
    };
    
    int main()
    {
        OffsetOf<int>::Type foo = 0;
    
        (void) foo;
    }
    
    
    $ xlC -c apar.cpp
    "apar.cpp", line 2.24: 1540-0130 (S) "LENGTH" is not declared.
    $
    

Local fix

Problem summary

  • PROBLEM DESCRIPTION:
    An incorrect instantiation point causes the compiler to miss an
    implicit instantiation required to compile resulting in an
    error for an invalid use of an incomplete class.
    
    USERS AFFECTED:
    The problem happens with the use of a default template
    parameter in a template class.
    

Problem conclusion

  • The problem has been resolved.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ08181

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    D13

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-08-02

  • Closed date

    2018-08-02

  • Last modified date

    2018-08-02

  • APAR is sysrouted FROM one or more of the following:

    IV99406

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"D13"}]

Document Information

Modified date:
24 August 2021