Fixes are available
October 2010 PTF for XL C/C++ for AIX, V10.1
May 2012 PTF for XL C/C++ for AIX, V10.1
January 2013 PTF for XL C/C++ for AIX, V10.1
XL C/C++ for AIX Fix Pack 18 (July 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 19 (October 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 21 (October 2015 PTF) for 10.1
March 2010 PTF for XL C/C++ for AIX, V10.1
April 2010 PTF for XL C/C++ for AIX, V10.1
June 2010 PTF for XL C/C++ for AIX, V10.1
May 2011 PTF for XL C/C++ for AIX, V10.1
October 2011 PTF for XL C/C++ for AIX, V10.1
February 2012 PTF for XL C/C++ for AIX, V10.1
September 2012 PTF for XL C/C++ for AIX, V10.1
XL C/C++ for AIX Fix Pack 20 (October 2014 PTF) for 10.1
APAR status
Closed as program error.
Error description
The following test case compiles with an error message on V10.1 xlC. "test1.cpp", line 7.15: 1540-0236 (S) The constructor initializer is unexpected. All bases and members have been initialized. But it compiles clean on V9, V8, and V7 xlC. It also compiles clean on Sun's CC compilers. With g++, the test case gives another error: test1.cpp: In constructor `B::B(int)': test1.cpp:7: error: class `B' does not have any field named `A' Is the test case ill-formed? But nonetheless, the error message from XLC++ is very confusing. ===== TESTCASE: //cat test1.cpp: template <class T> struct A { A () { } A (const T&) { } }; struct B : public A<int> { B (int v) : A(v) { } // diagnostic here is very misleading }; B f () { return 5; }
Local fix
Change B (int v) : A(v) { } // diagnostic here is very misleading to: B (int v) : A<int>(v) { }
Problem summary
USER AFFECTED: Users attempting to use the name of template base class without template arguments in the derived class - specifically in a constructor initializer list. PROBLEM DESCRIPTION: The behaviour for injected names has been clarified in the C++ standard so that this syntax is no longer permitted, however the compiler message is not useful.
Problem conclusion
Message now emitted is: 'a.cpp', line 7.15: 1540-1113 (S) The class template name 'A' must be followed by a < in this context.
Temporary fix
Comments
APAR Information
APAR number
IZ67449
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
2009-12-31
Closed date
2010-02-24
Last modified date
2010-03-12
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
Document Information
Modified date:
06 October 2021