Fixes are available
XL C/C++ for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 5 (November 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 6 (February 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 7 (May 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 8 (August 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 9 (June 2017 PTF) for 13.1
XL C/C++ for AIX Fix Pack 10 (February 2018 PTF) for 13.1
XL C/C++ for AIX Fix Pack 11 (November 2018 PTF) for 13.1
APAR status
Closed as program error.
Error description
A template function is not instantiated, and an incorrect template function is called when multiple template instantiations with the same function names with the same argument types exist. === TEST CASE === extern "C" printf(const char*, ...); typedef const char (*templatetype)(const char); template <char pre> const char test(const char src ) { if ( src != pre) { printf(" error src must be equal to pre\n"); } return src == pre ? src : 0; } class myClass { public: template <templatetype mx> const char check(const char start ) { const char c = mx(start); if (c) return c; else return 0; } }; int main() { myClass f; f.check < test<';'> >(';'); f.check < test<'.'> >('.'); } $ xlC test.cpp $ ./a.out error src must be equal to pre $
Local fix
Problem summary
USERS AFFECTED: Users with code that requires multiple template instantiations with same function names with same argument types are affected by this issue. PROBLEM DESCRIPTION: Template instantiation cache was selecting the cached candidate, looking at the arguments and assuming that the candidate is exact match.
Problem conclusion
The fix has been made so that the template instantiation cache is not used in case where function name and argument types are the same. This ensures that two separate instantiations happen when there is an ambiguity for the compiler.
Temporary fix
Comments
APAR Information
APAR number
IV72776
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2015-04-27
Closed date
2015-04-27
Last modified date
2015-04-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/C++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
RD10 PSY
[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"13.1"}]
Document Information
Modified date:
01 October 2021