Fixes are available
September 2010 PTF for XL C/C++ for AIX, V11.1
January 2011 PTF for XL C/C++ for AIX, V11.1
May 2011 PTF for XL C/C++ for AIX, V11.1
August 2011 PTF for XL C/C++ for AIX, V11.1
November 2011 PTF for XL C/C++ for AIX, V11.1
January 2012 PTF for XL C/C++ for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.1
APAR status
Closed as program error.
Error description
Compiling the following test case TemplateBug.cpp with xlC emits error: "TemplateBug.cpp", line 19.1: 1540-1174 (S) The member "template const Bar<T,0,1> &Bang(const Bar &)" is not declared as a template in its containing class definition. ===== TESTCASE: > cat TemplateBug.cpp enum Foo { Alpha, Beta }; template<typename T, Foo F, Foo G> class Bar; // Partial specialization of Bar template<typename T> class Bar<T,Alpha,Beta> { public: const Bar<T,Alpha,Beta>& Bang( const Bar<T,Alpha,Beta>& bar ); }; // Implementation of member function of partially specialized Bar template<typename T> const Bar<T,Alpha,Beta>& Bar<T,Alpha,Beta>::Bang ( const Bar<T,Alpha,Beta>& bar ) { return bar; } // Explicit instantiation template class Bar<double,Alpha,Beta>;
Local fix
Changing const Bar<T,Alpha,Beta>& to void makes it pass. for example: >cat TemplateNoBug.cpp enum Foo { Alpha, Beta }; template<typename T, Foo F, Foo G> class Bar; // Partial specialization of Bar template<typename T> class Bar<T,Alpha,Beta> { public: void Bang( const Bar<T,Alpha,Beta>& bar ); }; // Implementation of member function of partially specialized Bar template<typename T> void Bar<T,Alpha,Beta>::Bang ( const Bar<T,Alpha,Beta>& bar ) { } // Explicit instantiation template class Bar<double,Alpha,Beta>;
Problem summary
PROBLEM DESCRIPTION: The compiler is failing to match the out-of-line definition of a template member with a non-type parameter which is an enumeration. USERS AFFECTED: The problem affects users of template classes with non-type parameters of enumeration type.
Problem conclusion
The compiler was incorrectly matching the out-of-line member when a non-type template parameter was an enumeration type. The problem is fixed now.
Temporary fix
Comments
APAR Information
APAR number
IZ84764
Reported component name
XL C/C++ AIX
Reported component ID
5724X1300
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-09-10
Closed date
2010-09-10
Last modified date
2010-09-10
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++ AIX
Fixed component ID
5724X1300
Applicable component levels
Document Information
Modified date:
10 September 2010