Fixes are available
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
APAR status
Closed as program error.
Error description
The compiler issues an error message for the following test case: ===== COMPILE COMMAND: xlC_r -q32 -qthreaded -qalias=ansi -qlanglvl=extended0x -c test.cpp ===== TESTCASE: $ cat test.cpp template<typename TFrom, typename TTo = TFrom> TTo templateFunction(TFrom from) { return static_cast<TTo>(from); } int main() { long long value = templateFunction<long long>(55); return (value == 55); } $ ===== ACTUAL OUTPUT: $ /gsa/tlbgsa/projects/x/xlcmpbld/run/vacpp/121_com/aix/daily/late st/bin/xlC_r -q32 -qthreaded -qalias=ansi -qlanglvl=extended0x -c test.cpp "test.cpp", line 10.46: 1540-2465 (S) An object or reference of type "long long" cannot be initialized with a prvalue of type "TFrom". "test.cpp", line 5.25: 1540-2463 (S) An lvalue expression of type "long long" cannot be converted to type "TFrom". "test.cpp", line 5.25: 1540-0218 (I) The call does not match any parameter list for "TFrom::TFrom". "test.cpp", line 1.10: 1540-1283 (I) "implicit TFrom::TFrom(const TFrom &)" is not a viable candidate. "test.cpp", line 5.25: 1540-2463 (I) An lvalue expression of type "long long" cannot be converted to type "const TFrom &". "test.cpp", line 3.1: 1540-0700 (I) The previous message was produced while processing "templateFunction<long long,TFrom>(long long)". "test.cpp", line 8.5: 1540-0700 (I) The previous message was produced while processing "main()". $ ===== EXPECTED OUTPUT: Clean compile.
Local fix
N/A
Problem summary
USERS AFFECTED: Users how have initialization and lvalue conversions in their code may be affected by this issue. PROBLEM DESCRIPTION: The compiler results in a missing template argument substitution on default template argument for function templates; causig a compile time error.
Problem conclusion
The compiler has been fixed to allow function template default arguments to also contain template parameters.
Temporary fix
Comments
APAR Information
APAR number
IV67337
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2014-11-28
Closed date
2015-02-26
Last modified date
2015-02-26
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++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
Document Information
Modified date:
19 August 2024