A fix is available
APAR status
Closed as program error.
Error description
The signature for a template function with a const type parameter is being generated the same as the template function with a non-const type parameter. This is causing internal and external linkage conflicts because the same function name is being used for two different functions. ===== TEST CASE ===== template<class T> class MyClass { }; float testfunc(MyClass<float>) { return 1; } float testfunc(MyClass<const float>){ return 2; } void test() { MyClass<float> withfloat; MyClass<const float> withconstfloat; 1 == testfunc(withfloat); 2 == testfunc(withconstfloat); } line 5.7: 1540-0704 (S) The definitions of "float testfunc(MyClass<const float>)" and "float testfunc(MyClass<float>)" have the same linkage signature "testfunc__F7MyClassXTf_".
Local fix
N/A
Problem summary
PROBLEM DESCRIPTION: A problem with name mangling of template type parameters causes a compilation error. USERS AFFECTED: Users of templates instantiated using datatypes with cv-qualified names.
Problem conclusion
The name mangling behaviour was corrected in the V12.1 compiler by default. The fix for the V11.1 compiler is controlled via the option: -qxflag=MangleCVOnTemplateTypeArgs
Temporary fix
Comments
APAR Information
APAR number
IV30906
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
2012-10-26
Closed date
2013-02-07
Last modified date
2013-02-08
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 U858036
UP C
Rate this page:
Average rating
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.