IBM Support

LI74347: TEMPLATE CLASS COMPLETE ERROR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling the following test case, an error reporting that
    a template class declaration is using a class that is not
    complete is output.
    
    ------------------
    1540-1118 (S) The declaration of "test_object" uses t
    he undefined class "Foo<SomeObject>" when the class must be
    complete.
    ------------------
    
    To Compile:  xlC test.C
    
    
      ==========  TEST CASE  ==========
    
    struct AbstractFoo {};
    
    typedef AbstractFoo& (*FooLocator)();
    
    template<typename T>
    struct FooManager
    {
     static  AbstractFoo& GetFoo();
    };
    
    template<typename T, FooLocator locator>
    struct ArrayFoo {};
    
    struct SomeObject{};
    
    template<>
    AbstractFoo& FooManager<SomeObject>::GetFoo();
    
    struct AUser {
      ArrayFoo<SomeObject, FooManager<SomeObject>::GetFoo> comp;
    };
    
    template<typename T>
    struct Foo: public AbstractFoo{};
    
    template<>
    AbstractFoo& FooManager<SomeObject>::GetFoo() {
      static Foo<SomeObject> test_object;
      return test_object;
    }
    

Local fix

Problem summary

  • USER AFFECTED:
                        The problem is with complete template
    specializations (explicit specialization).
    
    PROBLEMDESCRIPTION:
                        A template instantiation was being created
    at an incorrect location causing a name lookup error indicating
    that a template instantiation was incomplete.
    

Problem conclusion

  • The problem is fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI74347

  • 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-03-31

  • Closed date

    2009-03-31

  • Last modified date

    2009-03-31

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

    LI74301

  • 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:
16 October 2021