Home | History | Annotate | Download | only in Parser
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 class A {};
      4 
      5 namespace B {
      6   namespace A {}
      7   using namespace A ;
      8 }
      9 
     10 namespace C {}
     11 
     12 namespace D {
     13 
     14   class C {
     15 
     16     using namespace B ; // expected-error{{not allowed}}
     17   };
     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 
     28 using namespace ! ; // expected-error{{expected namespace name}}
     29 using namespace A ; // expected-error{{expected namespace name}}
     30 using namespace ::A // expected-error{{expected namespace name}} \
     31                     // expected-error{{expected ';' after namespace name}}
     32                     B ;
     33 
     34 void test_nslookup() {
     35   int B;
     36   class C;
     37   using namespace B;
     38   using namespace C;
     39 }
     40 
     41