blob: 2ee014e54f4f04d99afb152688462a317b43085f [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
16 using namespace B ; // expected-error{{expected unqualified-id}}
17 //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}}
Chris Lattner823c44e2009-01-06 07:27:21 +000031using namespace ::A // expected-error{{expected namespace name}}
32 B ; // expected-error{{expected ';' after namespace name}}
Douglas Gregorf780abc2008-12-30 03:27:21 +000033
Douglas Gregoreb11cd02009-01-14 22:20:51 +000034void test_nslookup() {
35 int B;
36 class C;
37 using namespace B;
38 using namespace C;
39}
40