1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 template<typename T> 3 struct X { 4 X<T*> *ptr; 5 }; 6 7 X<int> x; 8 9 template<> 10 struct X<int***> { 11 typedef X<int***> *ptr; 12 }; 13 14 X<float>::X<int> xi = x; // expected-error{{qualified reference to 'X' is a constructor name rather than a template name}} 15 void f() { 16 X<float>::X<int> xi = x; // expected-error{{qualified reference to 'X' is a constructor name rather than a template name}} 17 } 18 19 // [temp.local]p1: 20 21 // FIXME: test template template parameters 22 template<typename T, typename U> 23 struct X0 { 24 typedef T type; 25 typedef U U_type; 26 typedef U_type U_type2; 27 28 void f0(const X0&); // expected-note{{here}} 29 void f0(X0&); 30 void f0(const X0<T, U>&); // expected-error{{redecl}} 31 32 void f1(const X0&); // expected-note{{here}} 33 void f1(X0&); 34 void f1(const X0<type, U_type2>&); // expected-error{{redecl}} 35 36 void f2(const X0&); // expected-note{{here}} 37 void f2(X0&); 38 void f2(const ::X0<type, U_type2>&); // expected-error{{redecl}} 39 }; 40 41 template<typename T, T N> 42 struct X1 { 43 void f0(const X1&); // expected-note{{here}} 44 void f0(X1&); 45 void f0(const X1<T, N>&); // expected-error{{redecl}} 46 }; 47 48 namespace pr6326 { 49 template <class T> class A { 50 friend class A; 51 }; 52 template class A<int>; 53 } 54 55 namespace ForwardDecls { 56 template<typename T> 57 struct X; 58 59 template<typename T> 60 struct X { 61 typedef T foo; 62 typedef X<T> xt; 63 typename xt::foo *t; 64 }; 65 } 66 67 namespace ConflictingRedecl { 68 template<typename> struct Nested { 69 template<typename> struct Nested; // expected-error {{member 'Nested' has the same name as its class}} 70 }; 71 } 72