This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25006] failure "using" a name contained in a class
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2005 21:09:25 -0000
- Subject: [Bug c++/25006] failure "using" a name contained in a class
- References: <bug-25006-11755@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from reichelt at gcc dot gnu dot org 2005-11-30 21:09 -------
This is really invalid code.
Paragraph [7.3.3]/6 states:
A using-declaration for a class member shall be a member-declaration.
In your code snippet "using ::Foo::Bar::FooBar;" is a using-declaration
for "FooBar" which is a class member of the class "::Foo::Bar". But since
the using-declaration is not inside a class, it is not a member-declaration
- which violates [7.3.3]/6.
Or the other way round: Because the using-declaration for "FooBar" is not
inside a class, it cannot be a member-declaration according to [7.3.3]/6.
Therefore "::Foo::Bar" cannot be a class-name - it has to be a
namespace-name. And that's what GCC's error message says.
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |RESOLVED
GCC build triplet|mingw-special |
GCC host triplet|mingw-special |
GCC target triplet|mingw-special |
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25006