IBM Support

LI77446: INCORRECT TEMPLATE SIGNATURE FOR CONST TYPE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The signature for a template function with a const type
    parameter is being generated the same as the template function
    with a non-const type parameter.  This is causing internal and
    external linkage conflicts because the same function name is
    being used for two different functions.
    
    
        ===== TEST CASE =====
    
    template<class T>
    class MyClass { };
    
    float testfunc(MyClass<float>)      { return 1; }
    float testfunc(MyClass<const float>){ return 2; }
    
    void test() {
        MyClass<float>       withfloat;
        MyClass<const float> withconstfloat;
    
        1 == testfunc(withfloat);
        2 == testfunc(withconstfloat);
    }
    
    
    line 5.7: 1540-0704 (S) The definitions of "float
    testfunc(MyClass<const float>)" and "float
    testfunc(MyClass<float>)" have the same linkage signature
    "testfunc__F7MyClassXTf_".
    

Local fix

  • N/A
    

Problem summary

  • PROBLEM DESCRIPTION:
    A problem with name mangling of template type parameters causes
    a compilation error.
    
    USERS AFFECTED:
    Users of templates instantiated using datatypes with
    cv-qualified names.
    

Problem conclusion

  • The name mangling behaviour was corrected in the V12.1 compiler
    by default.  The fix for the V11.1 compiler is controlled via
    the option:  -qxflag=MangleCVOnTemplateTypeArgs
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77446

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5724X1400

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2013-06-11

  • Closed date

    2013-06-11

  • Last modified date

    2013-06-11

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

    IV30906

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5724X1400

Applicable component levels

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

Document Information

Modified date:
14 October 2021