Fixes are available
April 2009 XL C/C++ Enterprise Edition V8.0 for AIX PTF
April 2010 XL C/C++ Enterprise Edition V8.0 for AIX PTF
June 2011 XL C/C++ Enterprise Edition V8.0 for AIX PTF
July 2009 XL C/C++ Enterprise Edition V8.0 for AIX PTF
October 2009 XL C/C++ Enterprise Edition V8.0 for AIX PTF
November 2008 XL C/C++ Enterprise Edition V8.0 for AIX PTF
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
IZ36662
Reported component name
XLC C++ AIX
Reported component ID
5724M1200
Reported release
800
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2008-11-05
Closed date
2008-11-07
Last modified date
2008-12-05
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
LI74002 LI74042 IZ40781 IZ42366 LI74255 LI74305 LI74461 LI74542
Fix information
Fixed component name
XLC C++ AIX
Fixed component ID
5724M1200
Applicable component levels
[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0"}]
Document Information
Modified date:
03 October 2021