export class foo { }; template x; export template x; export template<class T> class x0; template < ; template <int +> struct x1;
template <int +, T> struct x2; template<template<int+>> struct x3; template <template X> struct Err1; template <template <typename> > struct Err2; template <template <typename> Foo> struct Err3;
template <template <typename> typename Foo> struct Cxx1z;
#if __cplusplus <= 201402L
#endif
template <typename T> void foo();
template <typename T, typename U> void foo();
template <typename T> void foo() { }
template <typename T> struct A;
template <typename T, typename U> struct b;
template <typename> struct C;
template <typename, typename> struct D;
template <typename T = int> class X1;
template <typename = int> class X2;
template <template <typename> class T> class TTP1;
template <template <typename> class> class TTP2;
template <template <typename> class T = foo> class TTP3; template <template <typename> class = foo> class TTP3; template <template <typename X, typename Y> class T> class TTP5;
template <int> class NTP0;
template <int N> class NTP1;
template <int N = 5> class NTP2;
template <int = 10> class NTP3;
template <unsigned int N = 12u> class NTP4;
template <unsigned int = 12u> class NTP5;
template <unsigned = 15u> class NTP6;
template <typename T, T Obj> class NTP7;
template <typename T> struct A { };
template <typename T, typename U> struct B { };
template<typename T, typename T> void shadow1();
template<typename T> void shadow2(int T);
template<typename T> class T { };
template<int Size> void shadow3(int Size);
template<typename T> struct shadow4 {
int T; };
template<typename T> struct shadow5 {
int T(int, float); };
template<typename T, T T> void shadow6();
template<typename T, template<typename> class T> void shadow7();
template<template<typename> class T> struct shadow8 { template<template<typename> class T> struct inner; };
template<int Size>
void f(int& i) {
i = Size;
#ifdef DELAYED_TEMPLATE_PARSING
Size = i;
#else
Size = i; #endif
}
template<typename T>
const T& min(const T&, const T&);
void f2() {
int x;
A< typeof(x>1) > a;
}
template <> struct S<int> { }; template <> union U<int> { };
struct SS;
union UU;
template <> struct SS<int> { }; template <> union UU<int> { };
namespace PR6184 {
namespace N {
template <typename T>
void bar(typename T::x);
}
template <typename T>
void N::bar(typename T::x) { }
}
namespace PR17637 {
template <int>
struct L {
template <typename T>
struct O {
template <typename U>
static void Fun(U);
};
};
template <int k>
template <typename T>
template <typename U>
void L<k>::O<T>::Fun(U) {}
void Instantiate() { L<0>::O<int>::Fun(0); }
}
namespace explicit_partial_specializations {
typedef char (&oneT)[1];
typedef char (&twoT)[2];
typedef char (&threeT)[3];
typedef char (&fourT)[4];
typedef char (&fiveT)[5];
typedef char (&sixT)[6];
char one[1];
char two[2];
char three[3];
char four[4];
char five[5];
char six[6];
template<bool b> struct bool_ { typedef int type; };
template<> struct bool_<false> { };
#define XCAT(x,y) x ## y
#define CAT(x,y) XCAT(x,y)
#define sassert(_b_) bool_<(_b_)>::type CAT(var, __LINE__);
template <int>
struct L {
template <typename T>
struct O {
template <typename U>
static oneT Fun(U);
};
};
template <int k>
template <typename T>
template <typename U>
oneT L<k>::O<T>::Fun(U) { return one; }
template<>
template<>
template<typename U>
oneT L<0>::O<char>::Fun(U) { return one; }
void Instantiate() {
sassert(sizeof(L<0>::O<int>::Fun(0)) == sizeof(one));
sassert(sizeof(L<0>::O<char>::Fun(0)) == sizeof(one));
}
}
namespace func_tmpl_spec_def_in_func {
template <class> void FuncTemplate() {}
void TopLevelFunc() {
typename template <> void FuncTemplate<void>() { }
void NonTemplateInner() { }
}
}
namespace broken_baseclause {
template<typename T>
struct base { };
struct t1 : base<int, public: };
struct t2 : base<int, public };
}
namespace class_scope_instantiation {
struct A {
template<typename T> void f(T);
template void f<int>(int); template void f(float); extern template void f(double);
};
}
namespace PR42071 {
template<int SomeTemplateName<void>> struct A; template<int operator+> struct B; struct Q {};
template<int Q::N> struct C; template<int f(int a = 0)> struct D; }
namespace AnnotateAfterInvalidTemplateId {
template<int I, int J> struct A { };
template<int J> struct A<0, J> { }; template<int I> struct A<I, 0> { };
void f() { A<0, 0>::f(); } }
namespace PR45063 {
template<class=class a::template b<>> struct X {}; }
namespace NoCrashOnEmptyNestedNameSpecifier {
template <typename FnT,
typename T = typename ABC<FnT>::template arg_t<0>> void foo(FnT) {}
}
namespace PR45239 {
template<int> int b;
template<int> auto f() -> b<0>; }
namespace PR46231 {
template; template<>; template<int>; template int; template<> int; template<int> int; }