IBM Support

LI72692: SELF DEPENDENT TEMPLATE ERROR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following error occurs with template processing when
    matching the type of a templated class that relies on
    templates to itself.
    
    ------------------------------------------------------------
    "test.cpp", line 6.17: 1540-0716 (S) The template argument
    "TypeTemplate<Field>" does not match the template parameter
    "template class TypeTemplate".
    ------------------------------------------------------------
    
    ----------   test.cpp   ----------
    template<typename Field,
             template<typename> class TypeTemplate>
    class Test1: public TypeTemplate<Field>
    {
      public:
        Test1<Field,TypeTemplate> *p;
    };
    
    template<typename>
    class Test2{};
    
    int main()
    {
      Test1<double,Test2> a;
      return 0;
    }
    

Local fix

  • Replace "Test1<Field,TypeTemplate> *p;" with "Test1 *p;"
    

Problem summary

  • USERS AFFECTED:
    Users of template-template parameters, whom are also using the
    template-template class as a base class, and then attempt an
    instantiation in the derived class, using the template-template
    parameter.
    
    PROBLEM DESCRIPTION:
    The base-class was incorrectly being used in name-lookup instead
    of the template-template parameter (ie. it should have found
    the injected name instead of the base class).
    

Problem conclusion

  • Both the base and derived classes are now checked to see if they
    are template-dependent.  If either of them are, then we cannot
    use the "injected name" template (this allows us to move past
    the base class as a potential candidate, so we avoid the Error,
    then go on to find the correct name).
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI72692

  • Reported component name

    XL C/C++ AE BG/

  • Reported component ID

    5799HJE00

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2007-11-15

  • Closed date

    2008-02-14

  • Last modified date

    2008-02-14

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

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

    LI73515

Fix information

  • Fixed component name

    XL C/C++ AE BG/

  • Fixed component ID

    5799HJE00

Applicable component levels

  • R900 PSY

       UP

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

Document Information

Modified date:
16 October 2021