Fixes are available
November 2009 PTF for XL C/C++ for AIX, V10.1
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
August 2009 PTF for XL C/C++ for AIX, V10.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
Compiler incorrectly emits the following error messages for the testcase provided below: ===== COMPILE COMMAND: xlC_r -c -qlanglvl=extended 89717.7TD.000bug.cpp ===== TESTCASE: $ cat 89717.7TD.000bug.cpp ///Notes ///----- // 0. Compile with: /bb/util/version10-062009/usr/vacpp/bin/xlC_r -c bug.cpp // 1. Order is important. 'MySharedObj' and 'InplaceRepl' must come before // 'TestArg' and 'TestType' to reproduce the problem. // 2. 'If you replace 'InplaceRepl<TYPE>' inside 'MySharedObj' with just // 'TYPE *' and construct 'TYPE' directly, the problem goes away. // 3. In 'TestArg', replace the constructor with two constructors that do not // have default arguments, the problem goes away. template <class TYPE> class InplaceRepl { TYPE d_instance; public: template <class A1> InplaceRepl(const A1& a1); }; template <class TYPE> class MySharedObj { InplaceRepl<TYPE> *d_rep_p; public: template <class A1> MySharedObj(const A1& a1); }; template <class TYPE> template <class A1> MySharedObj<TYPE>::MySharedObj(const A1& a1) { typedef InplaceRepl<TYPE> Rep; Rep *rep = new Rep(a1); } template <class TYPE> template <class A1> InplaceRepl<TYPE>::InplaceRepl(const A1& a1) : d_instance(a1) { } //-------------------------------------------------------------- --------------- class TestArg { int *d_allocator_p; int d_value; public: TestArg(int value, int *allocator = 0); TestArg(const TestArg& original, int *allocator = 0); }; class TestType { TestArg d_a1; public: TestType(int *allocator = 0, TestArg a1 = 1); }; int *Z1; MySharedObj<TestType> x(Z1); ===== ACTUAL OUTPUT: "89717.7TD.000bug.cpp", line 36.3: 1540-0215 (S) The wrong number of arguments have been specified for "TestArg::TestArg(int, int *)". "89717.7TD.000bug.cpp", line 36.3: 1540-1205 (I) The error occurred while converting to parameter 2 of "TestType::TestType(int *, TestArg)". "89717.7TD.000bug.cpp", line 35.1: 1540-0700 (I) The previous message was produced while processing "InplaceRepl<TestType>::InplaceRepl(int * const &)". "89717.7TD.000bug.cpp", line 30.16: 1540-0700 (I) The previous message was produced while processing "MySharedObj<TestType>::MySharedObj(int * const &)". "89717.7TD.000bug.cpp", line 57.23: 1540-0700 (I) The previous message was produced while processing "x". ===== EXPECTED OUTPUT: Compiles clean.
Local fix
N/A
Problem summary
This problem occurs when 2 (or more) default function arguments are required for a constructor call in a constructor initializer list for a template class. The point of instantiation for the second default argument was invalid causing a name lookup error.
Problem conclusion
The instantiation point of the default is set correctly.
Temporary fix
Comments
APAR Information
APAR number
IZ56244
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-07-29
Closed date
2009-08-10
Last modified date
2009-08-27
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:
27 August 2009