Lines Matching full:template

2 // RUN: %clang_cc1 -fsyntax-only -verify %s -fdelayed-template-parsing -DDELAYED_TEMPLATE_PARSING
8 export class foo { }; // expected-error {{expected template}}
9 template x; // expected-error {{C++ requires a type specifier for all declarations}} \
11 export template x; // expected-error {{expected '<' after 'template'}}
12 export template<class T> class x0; // expected-warning {{exported templates are unsupported}}
13 template < ; // expected-error {{expected template parameter}} \
14 // expected-error{{expected ',' or '>' in template-parameter-list}} \
16 template <int +> struct x1; // expected-error {{expected ',' or '>' in template-parameter-list}}
18 // verifies that we only walk to the ',' & still produce errors on the rest of the template paramet…
19 template <int +, T> struct x2; // expected-error {{expected ',' or '>' in template-parameter-list}}…
21 template<template<int+>> struct x3; // expected-error {{expected ',' or '>' in template-parameter-l…
22 … expected-error {{template template parameter requires 'class' after the parameter list}}
23 template <template X> struct Err1; // expected-error {{expected '<' after 'template'}} \
25 template <template <typename> > struct Err2; // expected-error {{template template parameter …
26 template <template <typename> Foo> struct Err3; // expected-error {{template template parameter …
28 template <template <typename> typename Foo> struct Cxx1z;
33 // Template function declarations
34 template <typename T> void foo();
35 template <typename T, typename U> void foo();
37 // Template function definitions.
38 template <typename T> void foo() { }
40 // Template class (forward) declarations
41 template <typename T> struct A;
42 template <typename T, typename U> struct b;
43 template <typename> struct C;
44 template <typename, typename> struct D;
47 template <typename T = int> class X1;
48 template <typename = int> class X2;
50 // Forward declarations w/template template parameters
51 template <template <typename> class T> class TTP1;
52 template <template <typename> class> class TTP2;
53 template <template <typename> class T = foo> class TTP3; // expected-error{{must be a class templat…
54 template <template <typename> class = foo> class TTP3; // expected-error{{must be a class template}}
55 template <template <typename X, typename Y> class T> class TTP5;
58 template <int> class NTP0;
59 template <int N> class NTP1;
60 template <int N = 5> class NTP2;
61 template <int = 10> class NTP3;
62 template <unsigned int N = 12u> class NTP4;
63 template <unsigned int = 12u> class NTP5;
64 template <unsigned = 15u> class NTP6;
65 template <typename T, T Obj> class NTP7;
67 // Template class declarations
68 template <typename T> struct A { };
69 template <typename T, typename U> struct B { };
71 // Template parameter shadowing
72 template<typename T, // expected-note{{template parameter is declared here}}
73 typename T> // expected-error{{declaration of 'T' shadows template parameter}}
76 template<typename T> // expected-note{{template parameter is declared here}}
77 void shadow2(int T); // expected-error{{declaration of 'T' shadows template parameter}}
79 template<typename T> // expected-note{{template parameter is declared here}}
80 class T { // expected-error{{declaration of 'T' shadows template parameter}}
83 template<int Size> // expected-note{{template parameter is declared here}}
84 void shadow3(int Size); // expected-error{{declaration of 'Size' shadows template parameter}}
87 template<typename T> // expected-note{{here}}
92 template<typename T> // expected-note{{here}}
97 template<typename T, // expected-note{{template parameter is declared here}}
98 T T> // expected-error{{declaration of 'T' shadows template parameter}}
101 template<typename T, // expected-note{{template parameter is declared here}}
102template<typename> class T> // expected-error{{declaration of 'T' shadows template parameter}}
106 template<template<typename> class T> struct shadow8 { // expected-note{{template parameter is decla…
107template<template<typename> class T> struct inner; // expected-error{{declaration of 'T' shadows t…
110 // Non-type template parameters in scope
111 template<int Size>
121 template<typename T>
131 template <> struct S<int> { }; // expected-error{{explicit specialization of non-template struct 'S…
132 template <> union U<int> { }; // expected-error{{explicit specialization of non-template union 'U'}}
136 template <typename T>
140 template <typename T>
144 // This PR occurred only in template parsing mode.
146 template <int>
148 template <typename T>
150 template <typename U>
155 template <int k>
156 template <typename T>
157 template <typename U>
179 template<bool b> struct bool_ { typedef int type; };
180 template<> struct bool_<false> { };
187 template <int>
189 template <typename T>
191 template <typename U>
196 template <int k>
197 template <typename T>
198 template <typename U>
201 template<>
202 template<>
203 template<typename U>
215 // We failed to diagnose function template specialization definitions inside
217 template <class> void FuncTemplate() {}
221 typename template <> void FuncTemplate<void>() { }
228 template<typename T>