Namespace 'using' at global scope, recently broken
Josh Stern
jstern@citilink.com
Wed Aug 26 07:55:00 GMT 1998
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
More information about the Gcc-bugs
mailing list