Fixes are available
August 2012 PTF for XL C/C++ for AIX, V12.1
November 2012 PTF for XL C/C++ for AIX, V12.1
March 2013 PTF for XL C/C++ for AIX, V12.1
XL C/C++ for AIX Fix Pack 4 (June 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 7 (January 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
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 6 (December 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) 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 virtual template error message for the test case mentioned below: $cat test.cpp namespace sc{ template <class T> class Ref {}; } namespace sc { struct DistArray4Dimensions { public: static const DistArray4Dimensions& default_dim() { return default_dim_; } private: static DistArray4Dimensions default_dim_; }; class DistArray4 { public: virtual Ref<DistArray4> clone(const DistArray4Dimensions& dim = DistArray4Dimensions::default_dim()) =0; }; } namespace sc { class DistArray4_MPIIOFile: public DistArray4 { protected: template <typename Derived> Ref<DistArray4> clone(const DistArray4Dimensions& dim = DistArray4Dimensions::default_dim()); }; } $ ===== ACTUAL OUTPUT: $bgxlC -qarch=450d -qtune=450 -c test.cpp "test.cpp", line 34.49: 1540-1158 (S) The function template "sc::DistArray4_MPIIOFile::clone" must not be declared as virtual. $ ===== EXPECTED OUTPUT: Should compile clean.
Local fix
n/a
Problem summary
USERS AFFECTED: Users with member function templates which have the same name and parameter list as a base class virtual function are affected by this issue. PROBLEM DESCRIPTION: A template function which otherwise has the same name and parameter list as a base class virtual function may be incorrectly rejected with a message indicating that the template function may not be declared virtual. struct A { virtual void foo(); }; struct B : A { template <typename T> void foo(); // error message produced for this line }; The function is actually not declared virtual; however, it was mistakenly considered to override the base class virtual function. Specializations of member template functions should never be considered to override members of a base class.
Problem conclusion
A check was implemented to recognize that member function templates never override virtual functions.
Temporary fix
Comments
APAR Information
APAR number
IV25615
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
2012-08-02
Closed date
2012-08-02
Last modified date
2012-08-03
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
C
Document Information
Modified date:
21 August 2024