IBM Support

LI77868: TEMPLATE IS ALREADY DEFINED ERROR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • In the September 2013 PTF for XL C/C++ for AIX, V12.1
    (12.1.0.5), a program with the following definitions may
    encounter compilation error.
    
    template <size_t SIZE>
    inline bsl::ostream& operator<<(bsl::ostream& os, const
    LevelPrinter<const char[SIZE]>& lp)
    {...}
    
    template <size_t SIZE>
    inline bsl::ostream& operator<<(bsl::ostream& os, const
    LevelPrinter<char[SIZE]>& lp)
    {...}
    
    
    xlC -c test.cpp
    "test.cpp", line 50323.22: 1540-0403 (S) "template <size_t
    SIZE> TEST::operator<<(bsl::ostream &, const LevelPrinter<char
    [SIZE]> &)" is already defined.
    "test.cpp", line 50315.22: 1540-0425 (I) "operator<<" is
    defined on line 50315 of "test.cpp".
    

Local fix

  • N/A
    

Problem summary

  • PROBLEM DESCRIPTION: template functions collide when argument
    an array of const vs non-const causing a compile error
    indicating the template function was already defined
    
    USERS AFFECTED: Programs with a template argument that is an
    array when one function is an array of const and one is not
    

Problem conclusion

  • The problem is fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77868

  • Reported component name

    XL C/C++ FOR BG

  • Reported component ID

    5799AG100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2014-02-18

  • Closed date

    2014-02-18

  • Last modified date

    2014-02-18

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

    IV50473

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

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS2LWA","label":"XL C\/C++ for Blue Gene\/Q"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
05 September 2024