IBM Support

LI77636: ERROR MESSAGE ABOUT TEMPLATE DEFINITION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Reduced testcase:
    
    $cat b.cpp
    
    namespace Tpetra{
      template<class Scalar, class LocalOrdinal,class
    GlobalOrdinal,class Node> struct MultiVector {};
    }
    
    namespace Xpetra {
       template <class Scalar, class LocalOrdinal, class
    GlobalOrdinal, class Node> struct MultiVector{};
    }
    
    struct Epetra_MultiVector{};
    
    template <class Scalar, class LocalOrdinal, class
    GlobalOrdinal, class Node, class LocalMatOps>
    struct Utils {
         typedef LocalOrdinal  LO;
         typedef GlobalOrdinal GO;
         typedef Node          NO;
         typedef LocalMatOps   LMO;
         typedef Xpetra::MultiVector<Scalar, LocalOrdinal,
    GlobalOrdinal, Node> MultiVector;
         typedef Scalar    SC;
         static RCP<const Epetra_MultiVector>
    MV2EpetraMV(RCP<MultiVector> const Vec);
         static RCP< Tpetra::MultiVector<SC,LO,GO,NO> >
    MV2NonConstTpetraMV(RCP<MultiVector> Vec);
    };
    
    template <class Scalar, class LocalOrdinal, class
    GlobalOrdinal, class Node, class LocalMatOps>
    RCP<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal,
    Node> >
    Utils<Scalar, LocalOrdinal, GlobalOrdinal, Node,
    LocalMatOps>::MV2NonConstTpetraMV(RCP<MultiVector> Vec)   {  }
    
    template struct Utils<int,int,int,int,int>;
    
    $xlC b.cpp
    "b.cpp", line 29.1: 1540-1174 (S) The member "template
    RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
    MV2NonConstTpetraMV(RCP<MultiVector<Scalar,LocalOrdinal,GlobalOr
    dinal,Node> >)" is not declared as a template in its containing
    class definition.
    

Local fix

  • Define the member functions inside the class instead of
    out-of-line.
    

Problem summary

  • PROBLEM DESCRIPTION: The compiler was confusing matching names
    in different namespaces while resolving names in a template
    definition.   This caused an error that a member defined
    out-of-line was not defined in its class.
    
    USERS AFFECTED: The problem may be seen when a class refers to
    the instantiation of a template with the same name in 2
    different namespaces.
    

Problem conclusion

  • The problem has been resolved.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77636

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-28

  • Closed date

    2013-10-28

  • Last modified date

    2013-10-28

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

    LI77540

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5725C7300

Applicable component levels

  • RC10 PSY

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
14 October 2021