// Header for PCH test cxx-templates.cpp template struct S; template struct S { S() { } static void templ(); }; template struct S { static void partial(); }; template <> struct S { static void explicit_special(); }; template int tmpl_f2() { return x; } template T templ_f(T x) { int z = templ_f(3); z = tmpl_f2(); T data[y]; return x+y; } void govl(int); void govl(char); template struct Unresolv { void f() { govl(T()); } }; template struct Dep { typedef typename T::type Ty; void f() { Ty x = Ty(); T::my_f(); int y = T::template my_templf(0); ovl(y); } void ovl(int); void ovl(float); }; template inline T make_a(const A1& a1) { T::depend_declref(); return T(a1); } template class UseBase { void foo(); typedef int bar; }; template class UseA : public UseBase { using UseBase::foo; using typename UseBase::bar; }; template class Sub : public UseBase { }; template class mem_fun_t { public: explicit mem_fun_t(_Ret (_Tp::*__pf)()) {} private: _Ret (_Tp::*_M_f)(); }; template bool isInt(int x); template<> bool isInt<8>(int x) { try { ++x; } catch(...) { --x; } return true; } template int __copy_streambufs_eof(_CharT); class basic_streambuf { void m() { } friend int __copy_streambufs_eof<>(int); }; // PR 7660 template struct S_PR7660 { void g(void (*)(T)); }; template<> void S_PR7660::g(void(*)(int)) {} // PR 7670 template class C_PR7670; template<> class C_PR7670; template<> class C_PR7670; template struct S2 { static bool V; }; extern template class S2; template struct S3 { void m(); }; template inline void S3::m() { } template struct S4 { void m() { } }; extern template struct S4; void S4ImplicitInst() { S4 s; s.m(); } struct S5 { S5(int x); }; struct TS5 { S5 s; template TS5(T y) : s(y) {} }; // PR 8134 template void f_PR8134(T); template void f_PR8134(T); void g_PR8134() { f_PR8134(0); f_PR8134('x'); } // rdar8580149 template struct S6; template struct S6 { private: typedef const T t1[N]; public: typedef t1& t2; }; template struct S7; template struct S7 : S6 { }; // Zero-length template argument lists namespace ZeroLengthExplicitTemplateArgs { template void h(); struct Y { template void f(); }; template void f(T *ptr) { T::template g<>(17); ptr->template g2<>(17); h(); h(); Y y; y.f(); } struct X { template static void g(T); template void g2(T); }; } namespace NonTypeTemplateParmContext { template class Vector { }; struct String { template static String adopt(Vector&); }; template inline bool equalIgnoringNullity(const Vector& a, const String& b) { return false; } } // template< typename > class Foo; template< typename T > class Foo : protected T { public: Foo& operator=( const Foo& other ); }; template struct NestedExpansion { template auto f(A...a, B...b) -> decltype(g(a + b...)); }; template struct NestedExpansion;