blob: bf89bb19211fdf3b460d22dc200ae1242e905b05 [file] [log] [blame]
Douglas Gregorf780abc2008-12-30 03:27:21 +00001// RUN: clang -fsyntax-only -verify %s
2
3class A {};
4
5namespace B {
6 namespace A {}
7 using namespace A ;
8}
9
10namespace C {}
11
12namespace D {
13
14 class C {
15
Douglas Gregore950d4b2009-03-06 23:28:18 +000016 using namespace B ; // expected-error{{expected member name or ';' after declaration specifiers}}
Douglas Gregorf780abc2008-12-30 03:27:21 +000017 //FIXME: this needs better error message
18 };
19
20 namespace B {}
21
22 using namespace C ;
23 using namespace B::A ; // expected-error{{expected namespace name}}
24 //FIXME: would be nice to note, that A is not member of D::B
25 using namespace ::B::A ;
26 using namespace ::D::C ; // expected-error{{expected namespace name}}
27}
28
29using namespace ! ; // expected-error{{expected namespace name}}
30using namespace A ; // expected-error{{expected namespace name}}
Douglas Gregor4b2d3f72009-02-26 21:00:50 +000031using namespace ::A // expected-error{{expected namespace name}} \
32 // expected-error{{expected ';' after namespace name}}
33 B ;
Douglas Gregorf780abc2008-12-30 03:27:21 +000034
Douglas Gregoreb11cd02009-01-14 22:20:51 +000035void test_nslookup() {
36 int B;
37 class C;
38 using namespace B;
39 using namespace C;
40}
41