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 10 (October 2014 PTF) 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 generates an incorrect error message as shown below for the provided test case: ===== COMPILE COMMAND: xlC_r -q32 -qthreaded -qalias=ansi -qlanglvl=extended0x -qsuppress=1540-0198 -c test.cpp ===== TESTCASE: $ cat test.cpp namespace template_test { class FactoryBase { public: int value() const; }; class ReaderFactory : public FactoryBase { }; class WriterFactory : public FactoryBase { }; class DescriptionBase { public: virtual ?DescriptionBase() { } virtual ReaderFactory getRFactory() const = 0; virtual WriterFactory getWFactory() const = 0; }; template<class FactoryType> struct DescriptionFactory { static FactoryType getFactory(DescriptionBase *); }; template<> struct DescriptionFactory<ReaderFactory> { static ReaderFactory getFactory(DescriptionBase * _ptr) { return _ptr->getRFactory(); } }; template<> struct DescriptionFactory<WriterFactory> { static WriterFactory getFactory(DescriptionBase * _ptr) { return _ptr->getWFactory(); } }; class TemplateClass { public: template<typename Factory> int templateFunction(const DescriptionBase *); }; } template<typename Factory> int template_test::TemplateClass::templateFunction(const DescriptionBase * seriesList) { Factory factory = DescriptionFactory<Factory>::getFactory(seriesList); return factory.value(); } class NormalClass { protected: template_test::TemplateClass m_repositories; public: template<typename Factory> int templateFunction(const template_test::DescriptionBase * list) { return m_repositories.templateFunction<Factory>(list); } }; $ ===== ACTUAL OUTPUT: // xlC_r -q32 -qthreaded -qalias=ansi -qlanglvl=extended0x -qsuppress=1540-0198 -c test.cpp // // Result: // "test.cpp", line 66.23: 1540-0204 (S) An expression of type "int" must not be followed by the function call operator (). // "test.cpp", line 64.1: 1540-0700 (I) The previous message was produced while processing "template_test::TemplateClass::templateFunction<Factory>(const DescriptionBase *)". // "test.cpp", line 80.30: 1540-0700 (I) The previous message was produced while processing "template <class Factory> NormalClass::templateFunction(const DescriptionBase *)". ===== EXPECTED OUTPUT: Should compile clean
Local fix
N/A
Problem summary
USERS AFFECTED: Users who use -qlanglvl=extended0x or -qtmplparse=error may be affected by this issue. PROBLEM DESCRIPTION: Template type checking enabled by -qlanglvl=extended0x or -qtmplparse=error was attempting to do too much processing causing an invalid error.
Problem conclusion
The compiler has been fixed to handle the above scenario.
Temporary fix
Comments
APAR Information
APAR number
IV64515
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-09-03
Closed date
2014-10-23
Last modified date
2014-10-23
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
RC10 PSY UP
A
Document Information
Modified date:
21 August 2024