This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42490] using-directive in namespace doesn't work properly
- From: "schaub-johannes at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Feb 2010 23:28:16 -0000
- Subject: [Bug c++/42490] using-directive in namespace doesn't work properly
- References: <bug-42490-5473@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from schaub-johannes at web dot de 2010-02-11 23:28 -------
I also think the code is valid. In this case though, there is the complication
that no hiding takes place: The qualified name lookup of "X::m" for namespace
members says in 3.4.3.2/2: "using-directives are ignored in any namespace,
including X, directly containing one or more declarations of m". That would
mean that "using namespace B;" is ignored, because "C" is declared as a
namespace there.
But 3.4.4/3 says: "If the name is a qualified-id, the name is looked up
according its qualifications, as described in 3.4.3, but ignoring any non-type
names that have been declared.". That is, the declaration of the namespace is
ignored, thus not preventing the consideration of the using directive.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42490