This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Namespace 'using' at global scope, recently broken


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]