A fix is available
APAR status
Closed as program error.
Error description
The following test case fails on AIX with xlC with the error: "overloadresolutionbug.cpp", line 25.45: 1540-0270 (S) An object of type "CtorLookupFailClass<int>" cannot be constructed from an lvalue of type "UniqueType * const". "overloadresolutionbug.cpp", line 25.3: 1540-0700 (I) The previous message was produced while processing "OverloadResolutionBugClass<int>:: OverloadResolutionBugClass(UniqueType * const &)". "overloadresolutionbug.cpp", line 38.8: 1540-0700 (I) The previous message was produced while processing "struct C<UniqueType * const, OverloadResolutionBugClass<int> >". "overloadresolutionbug.cpp", line 52.5: 1540-0700 (I) The previous message was produced while processing "main()". ===== TESTCASE: $cat overloadresolutionbug.cpp.cpp template <typename TYPE> struct TypeClass { static TYPE& type(); }; class UninterestingType { }; template <class T > class CtorLookupFailClass { public: CtorLookupFailClass(); explicit CtorLookupFailClass(UninterestingType *); }; template <unsigned int INT> struct SingleTemplateValueClass { enum { VALUE = (int) INT }; }; template <class T> class OverloadResolutionBugClass : public CtorLookupFailClass<T> { public: template <class U> OverloadResolutionBugClass (const U& v) : CtorLookupFailClass<T>(v) { } }; struct UniqueType { } myTypeObj; struct B { static SingleTemplateValueClass<1> match(B&); template <typename T> static SingleTemplateValueClass<0> match(const T&); template <typename T> static SingleTemplateValueClass<0> match(const volatile T&); }; template <typename FROM_TYPE, typename TO_TYPE > struct C { private: struct Test { B& operator, (TO_TYPE) const; }; public: enum { VALUE = sizeof(B::match((TypeClass<Test>::type(), TypeClass<FROM_TYPE>::type()))) }; }; int main () { const int a = C<struct UniqueType * const , OverloadResolutionBugClass<int> >::VALUE; return 0; }
Local fix
N/A
Problem summary
PROBLEM DESCRIPTION: A template function is being instantiated in the operand of a sizeof, when sizeof operands are not to be evaluated USERS AFFECTED: the problem will only effect users who expect no template functions instantiated as part of the operand of a sizeof
Problem conclusion
template functions will no longer be instantiated when processing the operand of sizeof
Temporary fix
Comments
APAR Information
APAR number
IZ80294
Reported component name
XL C++ AIX
Reported component ID
5724U8100
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-07-16
Closed date
2010-10-05
Last modified date
2010-10-05
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++ AIX
Fixed component ID
5724U8100
Applicable component levels
[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1"}]
Document Information
Modified date:
06 October 2021