LI77516: THE MEMBER IS NOT DECLARED AS A TEMPLATE

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The compiler gives an unexpected error for the above test case.
    
    "ifpack2-ibm-compiler-bug-reproducer.cpp", line 21.54:
    1540-1174 (S) The member "template RCP<const foo<T>::T2>
    bar(T)" is not declared as a template in its containing class
    definition.
    
    ===== TESTCASE:
    cat ifpack2-ibm-compiler-bug-reproducer.cpp
    template <typename T> struct RCP {
      T x;
      RCP(T x_) : x(x_) {}
    };
    
    template <typename T>
    struct foo {
      typedef T T2;
      RCP<const T2> bar(T x) ;
    };
    
    template <typename T> RCP<const typename foo<T>::T2>
    foo<T>::bar(T x) {
      RCP<const T2> p(x);
      return p;
    }
    
    int main() {
      foo<int> f;
      RCP<const int> y = f.bar(1);
      return 0;
    }
    
    bgxlC ifpack2-ibm-compiler-bug-reproducer.cpp
    "ifpack2-ibm-compiler-bug-reproducer.cpp", line 21.54:
    1540-1174 (S) The member "template RCP<const foo<T>::T2>
    bar(T)" is not declared as a template in its containing class
    definition.
    

Local fix

  • Define the member inside its containing class:
    
    template <typename A> struct RCP {
      A x;
      RCP(A x_) : x(x_) {}
    };
    
    template <typename B>
    struct foo {
      typedef B T2;
      RCP<const T2> bar(B x) {
         RCP<const T2> p(x);
         return p;
       }
    };
    
    
    int main() {
      foo<int> f;
      RCP<const int> y = f.bar(1);
      return 0;
    }
    

Problem summary

  • PROBLEM DESCRIPTION: unable to match out-of-line definition of
    a member function of a template class
    
    USERS AFFECTED: The compiler incorrectly mismatched the return
    type of the member function when the return type had a
    cv-qualifier on the template type
    

Problem conclusion

  • the problem has been resolved. Apply applicable service.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77516

  • 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

  • Submitted date

    2013-07-15

  • Closed date

    2013-11-26

  • Last modified date

    2013-11-26

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

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

    IV49637 LI77633

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

  • RC10 PSY

       UP



Rate this page:

(0 users)Average rating

Document information


More support for:

XL C/C++ for Blue Gene/Q
Compiler

Software version:

12.1

Reference #:

LI77516

Modified date:

2013-11-26

Translate my page

Machine Translation

Content navigation