APAR status
Closed as program error.
Error description
The following test case triggers the error when compiled with xlC: ====COMPILE COMMAND: xlC_r test.cpp ====TESTCASE class ObjectManager; typedef ObjectManager& (*ObjectManagerFactory)(); template<class Object> class DefaultObjectManagerFactory { public: static ObjectManager& Retrieve(); }; class BaseInternalCollection; class BaseCollection { BaseInternalCollection* m_letter; public: BaseCollection(int size, ObjectManagerFactory factory); void Copy(const BaseCollection& iSrc, ObjectManagerFactory factory); void Die(ObjectManagerFactory factory); void BuildFromTuple(BaseInternalCollection* t, ObjectManagerFactory factory); protected: BaseCollection(); }; template<typename T, ObjectManagerFactory M> class InternalCollection; template<typename T, ObjectManagerFactory M = DefaultObjectManagerFactory<T>::Re trieve > class Collection : public BaseCollection { public: inline Collection() { } explicit inline Collection(int iSize) : BaseCollection(iSize, M) { } inline Collection(const Collection<T, M>& t) : BaseCollection(0, M) { BaseColl ection::Copy(t, M); } inline Collection<T, M>& operator=(const Collection<T, M>& t) { BaseCollection ::Copy(t, M); return *this; } inline void BuildFromTuple(InternalCollection<T, M>& iTuple) { BaseCollection: :BuildFromTuple((BaseInternalCollection*)&iTuple, M); } inline ~Collection() { Die(M); } }; struct Item { }; template<> ObjectManager& DefaultObjectManagerFactory<Item>::Retrieve(); class Event { Collection<Item> m_postProcessingTasks; //first 'usage' of DefaultObjectManage rFactory<Item>::Retrieve }; //'interface' ObjectManager class ObjectManager { public: const unsigned int m_width; inline ObjectManager(unsigned int width) : m_width(width) {} virtual void InitVect(void* dst, unsigned int count) const = 0; virtual void InitVect(void* dst, const void* src, unsigned int count) const; virtual int Compare(const void* ptr1, const void* ptr2) const = 0; }; struct NoCompareManager : public ObjectManager { NoCompareManager(unsigned int iSizeOf) : ObjectManager(iSizeOf) {} virtual void InitVect(void* to, unsigned sz) const; virtual int Compare(const void* v1, const void * v2) const; }; template<class T> struct BaseClassManager : public NoCompareManager { BaseClassManager() :NoCompareManager(sizeof(T)) {} virtual void InitVect(void *to, const void *from, unsigned sz) const { } }; template<class T> struct ClassManager : public BaseClassManager<T> //COMPILATION ERROR HERE: (S) T he base class "BaseClassManager<Item>" is declared but not defined. { virtual void InitVect(void *to, unsigned sz) const { } }; template<> ObjectManager& DefaultObjectManagerFactory<Item>::Retrieve() // (I) The previous message was produced while processing "DefaultObjectManagerFactory<Item>::Retri eve()". { static ClassManager<Item> s_mgr; // (I) The previous message was produced whil e processing "struct ClassManager<Item>". return s_mgr; } $
Local fix
N/A
Problem summary
USERS AFFECTED: Users with explicit specializations referenced in certain contexts before the definition of the explicit specialization are affected by this issue. PROBLEM DESCRIPTION: The set of names and semantic properties that are reachable from the definition of the explicit specialization may be determined incorrectly.
Problem conclusion
The treatment of the definition of explicit specializations has been made to be more consistent with that of non-template definitions.
Temporary fix
Comments
APAR Information
APAR number
IJ21750
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
G10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2019-12-24
Closed date
2019-12-24
Last modified date
2019-12-24
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C/C++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"G10","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]
Document Information
Modified date:
21 August 2024