Lines Matching full:template
4 template<typename T, int N = 2> struct X; // expected-note{{template is declared here}}
9 X<> *x3; // expected-error{{too few template arguments for class template 'X'}}
11 template<typename U = float, int M> struct X;
15 template<typename T = int> struct Z { };
16 template struct Z<>;
19 template<class T> struct a { };
20 template<> struct a<int> { static const bool v = true; };
22 template<class T, bool = a<T>::v> struct p { }; // expected-error {{no member named 'v'}}
24 template struct p<bool>; // expected-note {{in instantiation of default argument for 'p<bool>' required here}}
25 template struct p<int>;
28 template<typename T, typename U>
31 template<typename T, typename U = T>
34 template<typename T, typename U>
39 template<typename T>
42 template<>
47 // Nested default arguments for template parameters.
48 template<typename T> struct X1 { };
50 template<typename T>
52 template<typename U = typename X1<T>::type> // expected-error{{no type named 'type' in 'X1<int>'}} \
54 struct Inner1 { }; // expected-note{{template is declared here}}
56 template<T Value = X1<T>::value> // expected-error{{no member named 'value' in 'X1<int>'}} \
58 struct NonType1 { }; // expected-note{{template is declared here}}
60 template<T Value>
63 template<typename U>
65 template<typename X = T, typename V = U>
68 template<T Value1 = sizeof(T), T Value2 = sizeof(U),
74 X2<int> x2i; // expected-note{{in instantiation of template class 'X2<int>' requested here}}
77 X2<int>::Inner1<> x2bad; // expected-error{{too few template arguments for class template 'Inner1'}}
80 X2<int>::NonType1<> x2_nontype1_bad; // expected-error{{too few template arguments for class template 'NonType1'}}
82 // Check multi-level substitution into template type arguments
84 X2<char>::Inner3<int>::NonType2<> x2_deep_nontype; // expected-note{{in instantiation of template class 'X2<char>' requested here}}
86 template<typename T, typename U>
89 template<typename T>
99 // Template template parameter defaults
100 template<template<typename T> class X = X2> struct X3 { };
104 template<typename T>
110 template<typename T, template<typename> class X = T::template apply>
115 template<int> struct X5 {}; // expected-note{{has a different type 'int'}}
116 template<long> struct X5b {};
117 template<typename T,
118 template<T> class B = X5> // expected-error{{template template argument has different}} \
119 // expected-note{{previous non-type template parameter}}
123 X6<long> x6b; // expected-note{{while checking a default template argument}}
127 template<template<class> class X = B<int> > struct X7; // expected-error{{must be a class template}}
130 template<typename T> class allocator {};
131 template<typename T, typename U = allocator<T> > class vector {};
133 template<template<typename U, typename = allocator<U> > class container,
145 template<typename X>
147 template<typename T = int, typename U>
149 // expected-warning@-2 {{default template arguments for a function template are a C++11 extension}}
153 template<typename X>
154 template<typename T, typename U>
159 template <class T> struct X {
160 template <class U = typename T::type> static void f(int) {} // expected-error {{type 'int' cannot be used prior to '::' because it has no members}}
162 // expected-warning@-2 {{default template arguments for a function template are a C++11 extension}}
167 int g() { X<int>::f(0); } // expected-note {{in instantiation of template class 'DR1635::X<int>' requested here}}
171 template<typename T> void f1() {
174 template void f1<int>(); // expected-note{{in instantiation of function template specialization 'NondefDecls::f1<int>' requested here}}
177 template <typename T>