This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Namespace 'using' at global scope, recently broken
- To: Josh Stern <jstern at citilink dot com>
- Subject: Re: Namespace 'using' at global scope, recently broken
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 27 Aug 1998 19:17:43 -0300
- Cc: egcs-bugs at cygnus dot com
- References: <199808261452.JAA12788@homebase.citilink.com>
Josh Stern <jstern@citilink.com> writes:
> Simple attempts at namespace 'using' directives with global
> scope mis-fire with the 08-24 snapshot.
The snapshot is correct. You can't redefine the meaning of a type
name, see [namespace.udecl]/10.
> #include <X11/Xlib.h>
[defines struct ::Display]
> namespace Some { class Display {
[snip]
> }; }
> //using namespace Some; // doesn't work
> using Some::Display; // doesn't work
> int doSomething() {
> // using Some::Display; // works!
Since now you're in a different scope, the using declaration can hide
the declaration from the outer scope.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil