Fixes are available
January 2012 PTF for XL C/C++ for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
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
Consider the following test.cpp: ///////////// test.cpp ////////////////////// struct A { int bar() { return 0; } int bar() const { return 1; } }; template<typename T> void foo(T A::*) { } // (1) template<typename T> void foo(T (A::*)() const) { } // (2) int main() { foo(&A::bar); } // should expand via (2) above // XL C/C++ compiler cannot decide between (1) & (2) //////////////end of test.cpp /////////////// $xlC test.cpp "test.cpp", line 7.14: 1540-0219 (S) The call to "foo" has no best match. "test.cpp", line 7.18: 1540-1229 (I) Argument number 1 is an rvalue of type "overloaded function: A::bar". "test.cpp", line 6.27: 1540-1202 (I) No candidate is better than "foo<int>(int (A::*)() const)". "test.cpp", line 7.18: 1540-1231 (I) The conversion from argument number 1 to "int (A::*)() const" uses the resolved overloaded function "int A::bar() const". "test.cpp", line 5.27: 1540-1202 (I) No candidate is better than "foo<int ()>(int (A::*)())". "test.cpp", line 7.18: 1540-1231 (I) The conversion from argument number 1 to "int (A::*)()" uses the resolved overloaded function "int A::bar()".
Local fix
N/A
Problem summary
When applying template argument deduction with a type A that is a pointer to non-static member function type, the corresponding type P must match the cv-qualifier-seq of the type A exactly when using XL C/C++ for deduction to succeed. This may cause deduction to succeed where it would otherwise fail when the type of A is the address of a member function overloaded on the cv-qualifier-seq.
Problem conclusion
Fix is enabled with -qxflag=FunctionCVTmplArgDeduction2011 which also sets macro __IBMCPP_FUNC_CV_TMPL_ARG_DEDUCTION to 1. The new behaviour may become the default in a future release. Handling of cv-qualifier-seq in function types and cv-qualification is modified in template argument deduction.
Temporary fix
Comments
APAR Information
APAR number
IV11365
Reported component name
XL C/C++ AIX
Reported component ID
5724X1300
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-11-29
Closed date
2012-01-09
Last modified date
2012-01-09
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++ AIX
Fixed component ID
5724X1300
Applicable component levels
RB10 PSY U849548
UP C
Document Information
Modified date:
09 January 2012