Lines Matching full:template
11 template<typename T>
14 template<typename T>
15 CONST T cpi = T(3.1415926535897932385); // expected-note {{template is declared here}}
17 template<typename T> extern CONST T vc;
32 // template arguments are not deduced for uses of variable templates. in no_deduce()
33 int ipi = pi; // expected-error {{use of variable template 'pi' requires template arguments}} in no_deduce()
34 int icpi = cpi; // expected-error {{use of variable template 'cpi' requires template arguments}} in no_deduce()
37 template<typename T>
42 template<typename T>
63 … ipi = pi<int>; // expected-error {{'pi' does not name a template but is followed by template arg… in foo()
70 template<typename T> T v; // expected-error {{redefinition of 'v' as different kind of symbol}}
73 template<typename T> T v; // expected-note {{previous definition is here}}
77 template<typename T> T v0; // expected-note {{previous definition is here}}
78 template<typename T> T v0; // expected-error {{redefinition of 'v0'}}
80 template<typename T> T v; // expected-note {{previous definition is here}}
81 template<typename T> int v; // expected-error {{redefinition of 'v'}}
83 template<typename T> extern int v1; // expected-note {{previous template declaration is here}}
84 …template<int I> int v1; // expected-error {{template parameter has a different kind in templa…
87 template<typename T> T v;
92 … template<typename T, typename> T v; // expected-note 2{{previous template declaration is here}}
93 …template<typename T> T v; // expected-error {{too few template parameters in template redeclarat…
94 …template<typename T, typename, typename> T v; // expected-error {{too many template parameters in …
98 template<typename T> T v = T();
99 template<typename T> extern T v; // redeclaration is allowed \
101 …template<typename T> extern int v; // expected-error {{redeclaration of 'v' with a different ty…
104 …template<typename T> extern auto v; // expected-error {{declaration of variable 'v' with deduced…
107 template<typename T> T var = T(); // expected-note {{previous definition is here}}
113 …template<typename T> auto v0; // expected-error {{declaration of variable 'v0' with deduced type '…
114 template<typename T> auto v1 = T(); // expected-note {{previous definition is here}}
115 …template<typename T> int v1; // expected-error {{redefinition of 'v1' with a different type: 'in…
116 template<typename T> auto v2 = T(); // expected-note {{previous definition is here}}
117 template<typename T> T v2; // expected-error {{redefinition of 'v2'}}
118 template<typename T> auto v3 = T(); // expected-note {{previous definition is here}}
119 …template<typename T> extern T v3; // expected-error {{redeclaration of 'v3' with a different t…
120 template<typename T> auto v4 = T();
121 …template<typename T> extern auto v4; // expected-error {{declaration of variable 'v4' with deduc…
128 template<typename T>
129 T pi0a = T(3.1415926535897932385); // expected-note {{variable template 'pi0a' declared here}}
130 …template float pi0a<int>; // expected-error {{type 'float' of explicit instantiation of 'pi0a' doe…
132 template<typename T>
133 T pi0b = T(3.1415926535897932385); // expected-note {{variable template 'pi0b' declared here}}
134 …template CONST int pi0b<int>; // expected-error {{type 'const int' of explicit instantiation of 'p…
136 template<typename T>
137 T pi0c = T(3.1415926535897932385); // expected-note {{variable template 'pi0c' declared here}}
138 …template int pi0c<const int>; // expected-error {{type 'int' of explicit instantiation of 'pi0c' …
140 template<typename T>
142 template int pi0<int>; // expected-note {{previous explicit instantiation is here}}
143 template int pi0<int>; // expected-error {{duplicate explicit instantiation of 'pi0<int>'}}
145 template<typename T>
146 …CONST T pi1a = T(3.1415926535897932385); // expected-note {{variable template 'pi1a' declared her…
147 …template int pi1a<int>; // expected-error {{type 'int' of explicit instantiation of 'pi1a' does no…
149 template<typename T>
150 …CONST T pi1b = T(3.1415926535897932385); // expected-note {{variable template 'pi1b' declared her…
151 …template int pi1b<const int>; // expected-error {{type 'int' of explicit instantiation of 'pi1b' …
153 template<typename T>
155 template CONST int pi1<int>; // expected-note {{previous explicit instantiation is here}}
156 …template CONST int pi1<int>; // expected-error {{duplicate explicit instantiation of 'pi1<int>'}}
160 template<typename T> auto var0 = T();
161 …template auto var0<int>; // expected-error {{'auto' variable template instantiation is not allo…
163 template<typename T> auto var = T();
164 template int var<int>;
168 template<typename=int> int missing_args; // expected-note {{here}}
169 template int missing_args; // expected-error {{must specify a template argument list}}
179 template<typename T1, typename T2>
182 template<typename T>
185 template<typename T>
188 template<> CONST int pi2<int,int> = 4;
204 template<typename T1, typename T2>
207 template<typename T>
210 template<typename T>
220 template<typename T>
223 template<> float pi0<int> = 10;
224 template<> int pi0<const int> = 10;
226 template<typename T>
228 template<> CONST int pi1<int> = 10;
230 template<typename T>
232 template<> int pi2<const int> = 10;
234 template<typename T>
236 template<> int pi4<int> = 10;
240 template<typename T>
243 template<> int pi0<int> = 10; // expected-note 3{{previous definition is here}}
247 template<> int pi0<int> = 10; // expected-error {{redefinition of 'pi0<int>'}}
248 …template<> CONST int pi0<int> = 10; // expected-error {{redefinition of 'pi0' with a different typ…
249 …template<> float pi0<int> = 10; // expected-error {{redefinition of 'pi0' with a different type: '…
251 template<> auto pi0<int> = 10; // expected-error {{redefinition of 'pi0<int>'}}
255 template<typename T>
258 template<> CONST int pi1<int> = 10; // expected-note {{previous definition is here}}
259 template<> CONST int pi1<int> = 10; // expected-error {{redefinition of 'pi1<int>'}}
263 template<typename T>
264 T pi0 = T(3.1415926535897932385); // expected-note {{variable template 'pi0' declared here}}
266 template<> int pi0<int> = 10; // expected-note 2{{previous template specialization is here}}
267 template int pi0<int>; // expected-warning {{has no effect}}
268 …template float pi0<int>; // expected-error {{type 'float' of explicit instantiation of 'pi0' …
270 template<typename T1, typename T2>
273 template<typename T> CONST int pi2<T,int> = 2;
274 template CONST int pi2<int,int>;
277 template<typename T>
280 template int pi0<int>; // expected-note 2{{explicit instantiation first required here}}
281 …template<> int pi0<int> = 10; // expected-error {{explicit specialization of 'pi0' after instantia…
282 …template<> float pi0<int>; // expected-error {{explicit specialization of 'pi0' after instantia…
284 template<typename T1, typename T2>
287 template CONST int pi2<int,int>;
288 template<typename T> CONST int pi2<T,int> = 2;
293 template<typename T, typename> auto var0 = T();
294 template<typename T> auto var0<T,int> = T();
295 template<> auto var0<int,int> = 7;
297 template<typename T, typename> auto var = T();
298 template<typename T> T var<T,int> = T(5);
299 template<> int var<int,int> = 7;
314 template<typename T> T* var = new T();
316 template<typename T> auto var<T*> = T(); // expected-note {{previous definition is here}}
317 …template<typename T> T var<T*> = T(); // expected-error {{redefinition of 'var' with a differe…
323 …template<typename T> T v = {1234}; // expected-warning {{implicit conversion from 'int' to 'char'…
328 …int k = v<char>; // expected-note {{in instantiation of variable template specialization 'n…
341 template<typename T>
345 template<> float* arr<float> = &f;
362 template<typename T>
369 template float pi0a<float>;
372 template<> double pi0a<double> = 5.2;
376 template<typename T>
382 template float n0b::pi0b<float>;
385 template<> double n0b::pi0b<double> = 5.2;
389 template<typename T>
395 template<typename T>
406 template float pi1a<float>;
412 template<> double pi1a<double> = 5.2; // expected-error {{not in a namespace enclosing 'n1'}}
419 template float n1::pi1b<float>;
425 … template<> double n1::pi1b<double> = 5.2; // expected-error {{not in a namespace enclosing 'n1'}}
431 template<typename T> int a; // expected-note {{variable template 'a' declared here}}
432 …a<int>::b c; // expected-error {{qualified name refers into a specialization of variable template …
434 …{identifier followed by '<' indicates a class template specialization but 'a' refers to a variable…
439 template<typename T> int a;
440 int a<int>; // expected-error {{requires 'template<>'}}
445 template<typename T> const auto x = 1;
451 template <typename T> int* f();
452 template <typename T> void f();
453 …template<> int f<double>; // expected-error {{no variable template matches specialization; did you…
455 template <typename T> void g();
456 …template<> int g<double>; // expected-error {{no variable template matches specialization; did you…
460 template <typename... Args> struct Variadic_t { };
461 template <typename... Args> Variadic_t<Args...> Variadic;
467 template <typename> int var; // expected-note {{declared here}}
468 int x(var); // expected-error {{use of variable template 'var' requires template arguments}}