This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Namespace 'using' at global scope, recently broken
- To: egcs-bugs at cygnus dot com
- Subject: Namespace 'using' at global scope, recently broken
- From: Josh Stern <jstern at citilink dot com>
- Date: Wed, 26 Aug 1998 09:52:59 -0500 (CDT)
- Posted-Date: Wed, 26 Aug 1998 09:52:59 -0500 (CDT)
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