• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 namespace PR8019 {
4   struct x;
5   template<typename T> struct x2;
6   struct y {
7     struct PR8019::x { int x; };  // expected-error{{non-friend class member 'x' cannot have a qualified name}}
8 
9     struct inner;
10     struct y::inner { }; // expected-warning{{extra qualification on member 'inner'}}
11 
12     template<typename T>
13     struct PR8019::x2 { }; // expected-error{{non-friend class member 'x2' cannot have a qualified name}}
14 
15     template<typename T>
16     struct inner_template;
17 
18     template<typename T>
19     struct y::inner_template { }; // expected-warning{{extra qualification on member 'inner_template'}}
20   };
21 
22 }
23 
24 namespace NS {
25   void foo();
26   extern int bar;
27   struct X;
28   template<typename T> struct Y;
29   template<typename T> void wibble(T);
30 }
31 namespace NS {
foo()32   void NS::foo() {} // expected-warning{{extra qualification on member 'foo'}}
33   int NS::bar; // expected-warning{{extra qualification on member 'bar'}}
34   struct NS::X { }; // expected-warning{{extra qualification on member 'X'}}
35   template<typename T> struct NS::Y; // expected-warning{{extra qualification on member 'Y'}}
wibble(T)36   template<typename T> void NS::wibble(T) { } // expected-warning{{extra qualification on member 'wibble'}}
37 }
38