Fixes are available
March 2009 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
August 2009 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
May 2010 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
December 2010 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
XL C/C++ Advanced Edition for Blue Gene/P Fix Pack 17 (October 2013 Update) for 9.0
April 2011 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
August 2011 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
April 2012 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
August 2012 Update for XL C/C++ Advanced Edition for Blue Gene/P, V9.0
APAR status
Closed as program error.
Error description
The following test case is valid, but the xlC compiler generates error message about name lookup for "foo" did not find a declaration. ======= TEST CASE ====== test.cpp ------------------------------------- namespace mynamespace { } // close namespace mynamespace using namespace mynamespace; namespace mynamespace { namespace { void foo() {} // Line 11 } } // close namespace mynamespace int main(void) { ::foo(); // works foo(); // should work but doesn't // Line 19 } -------------------------------- xlC -c test.cpp "test.cpp", line 19.5: 1540-0274 (S) The name lookup for "foo" did not find a declaration. "test.cpp", line 11.10: 1540-1298 (I) "void foo()" needs to be declared in the containing scope to be found by name lookup.
Local fix
As a workaround, we suggest naming the unnamed namespace and adding a using directive: namespace mynamespace { } using namespace mynamespace; namespace mynamespace { namespace A { void foo() {} } using namespace A; }
Problem summary
USER AFFECTED: Affects codes with an unnamed namespace in a namespace, which has a previously specified using directive PROBLEMDESCRIPTION: Namelookup through the using directive will not see declarations in the nested unnamed namespace.
Problem conclusion
This namelookup defect has been corrected.
Temporary fix
Comments
APAR Information
APAR number
LI74255
Reported component name
XL C/C++ AE BG/
Reported component ID
5799HJE00
Reported release
900
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2009-03-20
Closed date
2009-03-20
Last modified date
2009-03-20
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++ AE BG/
Fixed component ID
5799HJE00
Applicable component levels
R900 PSN IZ36662
UP06/09/13
Document Information
Modified date:
16 October 2021