IBM Support

IZ28143: MISMATCH AFTER RESTART FOR FRIEND DECLARATION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Following error occurs when compiling with xlC.
    
    ------------------------------------------------------------
    "p3.cpp", line 16.25: 1540-1174 (S) The member "template void
    foo(B &)" is not declared as a template in its containing class
    definition.
    ------------------------------------------------------------
    
    ==========Testcase=============
    
    class B;
    
    template<class T1> struct A { void foo(B &b); };
    
    //  A<void> a;  // uncomments resolves the problem
    
    struct B {
        B(const A<int> &v);
        template<class T2> friend void A<T2>::foo(B &b);
    };
    
    template<> struct A<float> { A<int> _a; };
    
    template<class T3> void A<T3>::foo(B &b) { }
    
    int main() { }
    

Local fix

  • Uncommneting A<void> a; resolves the problem (see test
    case)
    

Problem summary

  • When attempting to define a friend member function from a
    template class the compiler produces the following error
    message: 1540-1174 (S) The member "template void foo (B &)" is
    not declared as a template in its containing class definition.
    
    User defining friend member functions from template classes
    out-of-line will be affected.
    

Problem conclusion

  • The compiler was changed, now it properly sees the function from
    the dependent template class which is trying to be friended.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ28143

  • Reported component name

    XLC C++ AIX

  • Reported component ID

    5724M1200

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2008-07-24

  • Closed date

    2008-08-18

  • Last modified date

    2008-12-05

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

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

    IZ32376 IZ34983 LI73922

Fix information

  • Fixed component name

    XLC AIX

  • Fixed component ID

    5724M1100

Applicable component levels

  • R800 PSY UP

       C

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSGH2K","label":"XL C for AIX"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
19 August 2024