1// RUN: %clang_cc1 -fsyntax-only -verify %s 2template<typename T> class A; // expected-note 2 {{template parameter is declared here}} expected-note{{template is declared here}} 3 4// [temp.arg.type]p1 5A<0> *a1; // expected-error{{template argument for template type parameter must be a type}} 6 7A<A> *a2; // expected-error{{use of class template 'A' requires template arguments}} 8 9A<int> *a3; 10A<int()> *a4; 11A<int(float)> *a5; 12A<A<int> > *a6; 13 14// Pass an overloaded function template: 15template<typename T> void function_tpl(T); 16A<function_tpl> a7; // expected-error{{template argument for template type parameter must be a type}} 17 18// Pass a qualified name: 19namespace ns { 20template<typename T> class B {}; // expected-note{{template is declared here}} 21} 22A<ns::B> a8; // expected-error{{use of class template 'ns::B' requires template arguments}} 23 24// [temp.arg.type]p2 25void f() { 26 class X { }; 27 A<X> * a = 0; // expected-warning{{template argument uses local type 'X'}} 28} 29 30struct { int x; } Unnamed; // expected-note{{unnamed type used in template argument was declared here}} 31A<__typeof__(Unnamed)> *a9; // expected-warning{{template argument uses unnamed type}} 32 33template<typename T, unsigned N> 34struct Array { 35 typedef struct { T x[N]; } type; 36}; 37 38template<typename T> struct A1 { }; 39A1<Array<int, 17>::type> ax; 40 41// FIXME: [temp.arg.type]p3. The check doesn't really belong here (it 42// belongs somewhere in the template instantiation section). 43