[Bug c++/50399] [c++11] Lookup error w/ enums
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 15 09:35:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50399
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-15 09:26:38 UTC ---
C++03 says "During the lookup for a name preceding the :: scope resolution
operator, object, function, and enumerator names are ignored."
So in -std=c++98 mode G++ is correct to ignore A::C::B and so finds B::F (Clang
gets this wrong)
In C++11 the enumeration is not ignored (because a nested-name-specifier could
refer to a scoped enumeration) so name lookup finds B in the enclosing
namespace, i.e. A::C::B
More information about the Gcc-bugs
mailing list