This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50399] [c++11] Lookup error w/ enums
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Sep 2011 09:26:38 +0000
- Subject: [Bug c++/50399] [c++11] Lookup error w/ enums
- Auto-submitted: auto-generated
- References: <bug-50399-4@http.gcc.gnu.org/bugzilla/>
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