// RUN: clang-cc -fsyntax-only -verify %s template U f0(T t) { return t.template get(); } template int &f1(T t) { // FIXME: When we pretty-print this, we lose the "template" keyword. return t.U::template get(); } struct X { template T get(); }; void test_f0(X x) { int i = f0(x); int &ir = f0(x); } struct XDerived : public X { }; void test_f1(XDerived xd) { int &ir = f1(xd); } // PR5213 template struct A {}; template class B { A a_; public: void destroy(); }; template void B::destroy() { a_.~A(); } void do_destroy_B(B b) { b.destroy(); } struct X1 { int* f1(int); template float* f1(T); static int* f2(int); template static float* f2(T); }; void test_X1(X1 x1) { float *fp1 = x1.f1<>(17); float *fp2 = x1.f1(3.14); int *ip1 = x1.f1(17); float *ip2 = x1.f1(3.14); float* (X1::*mf1)(int) = &X1::f1; float* (X1::*mf2)(int) = &X1::f1<>; float* (X1::*mf3)(float) = &X1::f1; float* (*fp3)(int) = &X1::f2; float* (*fp4)(int) = &X1::f2<>; float* (*fp5)(float) = &X1::f2; float* (*fp6)(int) = X1::f2; float* (*fp7)(int) = X1::f2<>; float* (*fp8)(float) = X1::f2; } template struct X2 { int m; }; template struct X3 : T { }; template struct X4 { template void f(X2().U::m)>); }; void f(X4 > x4i) { X2 x2; x4i.f >(x2); }