blob: 1e918996d1470d8f6edf7747a8428f212892407d [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregorf780abc2008-12-30 03:27:21 +00002
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 Gregor9cfbe482009-06-20 00:51:54 +000016 using namespace B ; // expected-error{{not allowed}}
Douglas Gregorf780abc2008-12-30 03:27:21 +000017 };
18
19 namespace B {}
20
21 using namespace C ;
22 using namespace B::A ; // expected-error{{expected namespace name}}
23 //FIXME: would be nice to note, that A is not member of D::B
24 using namespace ::B::A ;
25 using namespace ::D::C ; // expected-error{{expected namespace name}}
26}
27
28using namespace ! ; // expected-error{{expected namespace name}}
29using namespace A ; // expected-error{{expected namespace name}}
Douglas Gregor4b2d3f72009-02-26 21:00:50 +000030using namespace ::A // expected-error{{expected namespace name}} \
31 // expected-error{{expected ';' after namespace name}}
32 B ;
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