Home | History | Annotate | Download | only in SemaCXX
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 namespace A {
      3   namespace B {
      4     class C { };
      5     struct S { };
      6     union U { };
      7   }
      8 }
      9 
     10 void f() {
     11   A::B::i; // expected-error {{no member named 'i' in namespace 'A::B'}}
     12   A::B::C::i; // expected-error {{no member named 'i' in 'A::B::C'}}
     13   ::i; // expected-error {{no member named 'i' in the global namespace}}
     14 }
     15 
     16 namespace B {
     17   class B { };
     18 }
     19 
     20 void g() {
     21   A::B::D::E; // expected-error {{no member named 'D' in namespace 'A::B'}}
     22   B::B::C::D; // expected-error {{no member named 'C' in 'B::B'}}
     23   ::C::D; // expected-error {{no member named 'C' in the global namespace}}
     24 }
     25 
     26 int A::B::i = 10; // expected-error {{no member named 'i' in namespace 'A::B'}}
     27 int A::B::C::i = 10; // expected-error {{no member named 'i' in 'A::B::C'}}
     28 int A::B::S::i = 10; // expected-error {{no member named 'i' in 'A::B::S'}}
     29 int A::B::U::i = 10; // expected-error {{no member named 'i' in 'A::B::U'}}
     30 
     31 using A::B::D; // expected-error {{no member named 'D' in namespace 'A::B'}}
     32 
     33 struct S : A::B::C {
     34   using A::B::C::f; // expected-error {{no member named 'f' in 'A::B::C'}}
     35 
     36 };
     37