IBM Support

LI75050: MISSING INSTANTIATION WITH LOCAL CLASS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An invalid error is generated related to a missing instantiated
    template with a local class.
    
    -----------------------------------------
    "t.C", line 12.12: 1540-0253 (S) This use of undefined class
    "R<A>" is not valid
    -----------------------------------------
    
      === TEST CASE ===
    
    #include <new>
    
    template<class T> class R { };
    template<class T> T* baz() { return NULL; }
    
    struct A { };
    
    R<A> foo();
    void bar(R<A>, A*);
    
    //template class R<A>; // uncommenting this fixes the error
    1540-0253
    
    int main(int ac, char **av) {
    struct F {
    ~F() { }
    } f;
    bar(foo(), new (baz<A>()) A());
    }
    

Local fix

  • Provide forward declaration for template class.
    

Problem summary

  • USER AFFECTED:
    The problem appears when a function body has a local class
    with a user-defined destructor followed by an implicit
    instantiation.
    
    PROBLEM DESCRIPTION:
    In certain cases the implicit instantiation might be missed
    causing an error that the template instance is not defined.
    

Problem conclusion

  • The implicit instantiation is created when required.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75050

  • Reported component name

    XL C/C++ RHEL52

  • Reported component ID

    5724U8310

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-12-01

  • Closed date

    2009-12-01

  • Last modified date

    2009-12-01

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

    IZ48094

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

Fix information

  • Fixed component name

    XL C/C++ RHEL52

  • Fixed component ID

    5724U8310

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
14 October 2021