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]

Namespace 'using' at global scope, recently broken



Simple attempts at namespace 'using' directives with global
scope mis-fire with the 08-24 snapshot.  This did work fairly
recently.  Here is a simple test case (as noted below,
the using directive at function scope is okay):


*********** dumm.h **********************************

#include <X11/Xlib.h>

namespace Some {

  class Display {
    ::Display* _xDisplay;
  public:
    Display() : _xDisplay(NULL) {}
    ::Display* xDisplay() const { return _xDisplay; }
  };

}


*********************** dumm.cc **********************



#include "dumm.h"

#include <X11/Xlib.h>

//using namespace Some;  // doesn't work
using Some::Display;  // doesn't work


int doSomething() {
  //  using Some::Display;  // works!

  Display d;

  if (d.xDisplay() == NULL) {
    ::Display* d = XOpenDisplay(":0.0");
  }
}

***********************************************************



- Josh

jstern@citilink.com




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