IBM Support

LI77540: 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

    LI77540

  • 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 / Xsystem

  • Submitted date

    2013-08-08

  • 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:

    LI77636 IV53339

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS2LWA","label":"XL C\/C++ for Blue Gene\/Q"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
05 September 2024