// RUN: %clang_cc1 -fsyntax-only -verify %s template class s0 { template class s1 : public s0 { ~s1() {} s0 ms0; }; }; struct Incomplete; template void destroy_me(T me) { me.~T(); } template void destroy_me(Incomplete*); namespace PR6152 { template struct X { void f(); }; template struct Y { }; template void X::f() { Y *y; y->template Y::~Y(); y->template Y::~Y(); y->~Y(); } template struct X; } namespace cvquals { template void f(int *ptr) { ptr->~T(); } template void f(int *); } namespace PR7239 { template class A { }; class B { void f() { A* x; x->A::~A(); } }; } namespace PR7904 { struct Foo { template ~Foo() {} // expected-error{{destructor cannot be declared as a template}} }; Foo f; } namespace rdar13140795 { template class shared_ptr {}; template struct Marshal { static int gc(); }; template int Marshal::gc() { shared_ptr *x; x->template shared_ptr::~shared_ptr(); return 0; } void test() { Marshal::gc(); } }