Fixes are available
XL C/C++ for Blue Gene/Q Fix Pack 12 (May 2015 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 14 (May 2016 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 15 (October 2017 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 6 (November 2013 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 7 (February 2014 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 8 (May 2014 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 9 (August 2014 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 10 (November 2014 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 11 (February 2015 Update) for 12.1
XL C/C++ for Blue Gene/Q Fix Pack 13 (August 2015 Update) for 12.1
APAR status
Closed as program error.
Error description
The compiler gives an unexpected error for the above test case. "ifpack2-ibm-compiler-bug-reproducer.cpp", line 21.54: 1540-1174 (S) The member "template RCP<const foo<T>::T2> bar(T)" is not declared as a template in its containing class definition. ===== TESTCASE: cat ifpack2-ibm-compiler-bug-reproducer.cpp template <typename T> struct RCP { T x; RCP(T x_) : x(x_) {} }; template <typename T> struct foo { typedef T T2; RCP<const T2> bar(T x) ; }; template <typename T> RCP<const typename foo<T>::T2> foo<T>::bar(T x) { RCP<const T2> p(x); return p; } int main() { foo<int> f; RCP<const int> y = f.bar(1); return 0; } bgxlC ifpack2-ibm-compiler-bug-reproducer.cpp "ifpack2-ibm-compiler-bug-reproducer.cpp", line 21.54: 1540-1174 (S) The member "template RCP<const foo<T>::T2> bar(T)" is not declared as a template in its containing class definition.
Local fix
Define the member inside its containing class: template <typename A> struct RCP { A x; RCP(A x_) : x(x_) {} }; template <typename B> struct foo { typedef B T2; RCP<const T2> bar(B x) { RCP<const T2> p(x); return p; } }; int main() { foo<int> f; RCP<const int> y = f.bar(1); return 0; }
Problem summary
PROBLEM DESCRIPTION: unable to match out-of-line definition of a member function of a template class USERS AFFECTED: The compiler incorrectly mismatched the return type of the member function when the return type had a cv-qualifier on the template type
Problem conclusion
the problem has been resolved. Apply applicable service.
Temporary fix
Comments
APAR Information
APAR number
LI77516
Reported component name
XL C/C++ FOR BG
Reported component ID
5799AG100
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2013-07-15
Closed date
2013-11-26
Last modified date
2013-11-26
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 BG
Fixed component ID
5799AG100
Applicable component levels
Document Information
Modified date:
05 September 2024