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
The following test case picks up the incorrect template instantiation resulting in an incorrect output at runtime. ===== COMPILE COMMAND: xlC_r ntest.cpp ===== TESTCASE: $cat ntest.cpp #include <iostream> template <class FUNC> struct hasEllipsis { enum {VALUE = 0}; }; template <class RET> struct hasEllipsis<RET (*)(...)> { enum {VALUE = 1}; }; template <class RET, class A1> struct hasEllipsis<RET (*)(A1,...)> { enum {VALUE = 2}; }; template <class RET, class A1, class A2> struct hasEllipsis<RET (*)(A1,A2,...)> { enum {VALUE = 3}; }; template <class RET, class A1, class A2, class A3> struct hasEllipsis<RET (*)(A1,A2,A3,...)> { enum {VALUE = 4}; }; void foo(int a) { std::cout << "foo" << std::endl; } void bar(int a, ...) { std::cout << "bar" << std::endl; } template<class FUNC> void check(FUNC f) { std::cout << "\tcheck: " << hasEllipsis<FUNC>::VALUE << std::endl; } int main() { std::cout << "foo: should print 0" << std::endl; // Should print 0 since the signature of 'foo' doesn't have an ellipsis. check(&foo); // prints '2' instead std::cout << "bar: should print 2" << std::endl; // Should print 2 since the signature of 'bar' does have an ellipsis. check(&bar); // correctly prints '2'. return 0; } ===== ACTUAL OUTPUT: $ ./a.out foo: should print 0 check: 2 bar: should print 2 check: 2 $ ===== EXPECTED OUTPUT: $ ./a.out foo: should print 0 check: 0 bar: should print 2 check: 2 $
Local fix
n/a
Problem summary
This problem happens when there is a partial specialization based on a function type where 1 parameter is an ellipsis The compiler was allowing the specialization to match a function with no ellipsis and picking an incorrect partial specialization
Problem conclusion
A problem in argument deduction was fixed to allow proper partial specialization matching with ellipsis in function type.
Temporary fix
Comments
APAR Information
APAR number
IZ55763
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-22
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:
03 October 2021