1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 template<typename T> struct vector; 3 4 // C++ [temp.class.spec]p6: 5 namespace N { 6 namespace M { 7 template<typename T> struct A; // expected-note{{here}} 8 } 9 } 10 11 template<typename T> 12 struct N::M::A<T*> { }; // expected-warning{{C++11 extension}} 13 14 // C++ [temp.class.spec]p9 15 // bullet 1 16 template <int I, int J> struct A {}; 17 template <int I> struct A<I+5, I*2> {}; // expected-error{{depends on}} 18 template <int I, int J> struct B {}; 19 template <int I> struct B<I, I> {}; //OK 20 21 // bullet 2 22 template <class T, T t> struct C {}; // expected-note{{declared here}} 23 template <class T> struct C<T, 1>; // expected-error{{specializes}} 24 template <class T, T* t> struct C<T*, t>; // okay 25 26 template< int X, int (*array_ptr)[X] > class A2 {}; // expected-note{{here}} 27 int array[5]; 28 template< int X > class A2<X, &array> { }; // expected-error{{specializes}} 29 30 template<typename T, int N, template<typename X> class TT> 31 struct Test0; 32 33 // bullet 3 34 template<typename T, int N, template<typename X> class TT> 35 struct Test0<T, N, TT>; // expected-error{{does not specialize}} 36 37 // C++ [temp.class.spec]p10 38 template<typename T = int, // expected-error{{default template argument}} 39 int N = 17, // expected-error{{default template argument}} 40 template<typename X> class TT = ::vector> // expected-error{{default template argument}} 41 struct Test0<T*, N, TT> { }; 42 43 template<typename T> struct Test1; 44 template<typename T, typename U> // expected-note{{non-deducible}} 45 struct Test1<T*> { }; // expected-warning{{never be used}} 46