Fixes are available
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 processing a template class type parameter, the compiler is incorrectly flagging a valid type as invalid. The issue appears related to the order of class definitions and the location of user constructor definitions (inside, or outside their respective class). ===== TEST CASE ===== template <class T> class Class1 { public: Class1(const T& value = T()); }; template <class T> Class1<T>::Class1(const T&) { } template <class T> class Class2 { Class1<T> mem; public: Class2() {} }; struct myType { }; int main(int argc, char *argv[]) { Class2<myType> obj2; return 0; } $ xlC tmp.cpp line 5.41: 1540-0253 (S) This use of undefined class "myType" is not valid. line 18.14: 1540-1205 (I) The error occurred while converting to parameter 1 of "Class1<myType>::Class1(const myType &)". line 18.5: 1540-0700 (I) The previous message was produced while processing "Class2<myType>::Class2()". line 27.20: 1540-0700 (I) The previous message was produced while processing "main(int, char *[])". $
Local fix
Change location of class constructors, or change the order of the template type parameter class definitions.
Problem summary
PROBLEM DESCRIPTION: Name lookup of dependent name at the wrong location causes an incomplete type error. USERS AFFECTED: May be seen in code with template-dependent default arguments.
Problem conclusion
The fix has now been included in the V11.1 compiler release.
Temporary fix
Comments
APAR Information
APAR number
IV25325
Reported component name
XL C++ AIX
Reported component ID
5724U8100
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2012-07-27
Closed date
2012-10-03
Last modified date
2012-10-03
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
IV29506 LI77056
Fix information
Fixed component name
XL C/C++ AIX
Fixed component ID
5724X1300
Applicable component levels
RB10 PSY U855106
UP A
Document Information
Modified date:
03 October 2012