Fixes are available
March 2009 Update for XL C/C++ for Linux, V10.1
October 2009 Update for XL C/C++ for Linux, V10.1
June 2011 Update for XL C/C++ for Linux, V10.1
XL C/C++ for Linux Fix Pack 8 (January 2014 Update) for 10.1
August 2010 Update for XL C/C++ for Linux, V10.1
January 2011 Update for XL C/C++ for Linux, V10.1
January 2012 Update for XL C/C++ for Linux, V10.1
July 2012 Update for XL C/C++ for Linux, V10.1
APAR status
Closed as program error.
Error description
Following error occurs when compiling with xlC. ------------------------------------------------------------ "p3.cpp", line 16.25: 1540-1174 (S) The member "template void foo(B &)" is not declared as a template in its containing class definition. ------------------------------------------------------------ ==========Testcase============= class B; template<class T1> struct A { void foo(B &b); }; // A<void> a; // uncomments resolves the problem struct B { B(const A<int> &v); template<class T2> friend void A<T2>::foo(B &b); }; template<> struct A<float> { A<int> _a; }; template<class T3> void A<T3>::foo(B &b) { } int main() { }
Local fix
Uncommneting A<void> a; resolves the problem (see test case)
Problem summary
When attempting to define a friend member function from a template class the compiler produces the following error message: 1540-1174 (S) The member "template void foo (B &)" is not declared as a template in its containing class definition. User defining friend member functions from template classes out-of-line will be affected.
Problem conclusion
The compiler was changed, now it properly sees the function from the dependent template class which is trying to be friended.
Temporary fix
Comments
APAR Information
APAR number
LI74399
Reported component name
XL C/C++ RHEL52
Reported component ID
5724U8310
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2009-03-31
Closed date
2009-03-31
Last modified date
2009-03-31
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++ RHEL52
Fixed component ID
5724U8310
Applicable component levels
RA10 PSN LI74309
UP06/09/13
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Document Information
Modified date:
16 October 2021