Fixes are available
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
When creating an instantiation of a normal template class that uses a static member function from a different, explicit specialization template class, the compiler is incorrectly generating an error. This incorrect behaviour is demonstrated in the following test case, where the explicitly specialized template class's primary template class does not have a definition, but the explicit specialization does. This is valid, because the definition of an explicitly specialized template class is unrelated to the definition of the primary template. The primary template is not required to be defined in order to define the specialization. ===== TEST CASE ===== template <class T> class MyClass { private: static int const value; }; template <class T> struct ExpSpec; //template<class T> struct ExpSpec { }; // primary template // Uncomment the primary definition, and the test case passes template<> // explicit specialization template struct ExpSpec<unsigned int> { static int getvalue() { return 7; } }; template <class T> int const MyClass<T>::value = ExpSpec<T>::getvalue(); template class MyClass<unsigned int>; // instantiation ===== Compile ===== $ xlC -c test.cpp "test.cpp", line 19.31: 1540-0062 (S) The incomplete class "ExpSpec" must not be used as a qualifier. $
Local fix
Add a stub definition for the primary template class.
Problem summary
PROBLEM DESCRIPTION: A compiler parsing error on an initializer for an out-of-line definition of a template member variable. USERS AFFECTED: The problem will only affect initializers which have a template name in the qualifier.
Problem conclusion
The problem has been resolved, and the compiler no longer emits the error.
Temporary fix
Comments
APAR Information
APAR number
IV10074
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
2011-11-02
Closed date
2011-11-02
Last modified date
2011-11-03
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
RB10 PSN U848679
UP06/09/13 C
Document Information
Modified date:
03 November 2011