c++ - [bug] using namespace leaks into surrounding namespace.
- Daniel James (24/24) May 31 2005 The following shouldn't compile, but does. The commented line will fail
The following shouldn't compile, but does. The commented line will fail as expected if it's includeed. namespace n1 { struct x {}; } namespace n2 { void y() { using namespace n1; } //x a; } n2::x b; This also causes the following code to fail with an 'ambiguous reference to symbol' error: namespace n1 { struct x {}; } namespace n2 { void y() { using namespace n1; } struct x {}; } n2::x a;
May 31 2005