1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3 template<typename A
> class s0
{
5 template<typename B
> class s1
: public s0
<A
> {
15 void destroy_me(T me
) {
19 template void destroy_me(Incomplete
*);
22 template<typename T
> struct X
{ void f(); };
23 template<typename T
> struct Y
{ };
27 y
->template Y
<T
>::~Y();
28 y
->template Y
<T
>::~Y
<T
>();
32 template struct X
<int>;
41 template void f
<const volatile int>(int *);
45 template<class E
> class A
{ };
57 Foo::~Foo() { // expected-error{{destructor cannot be declared as a template}}
65 namespace rdar13140795
{
66 template <class T
> class shared_ptr
{};
68 template <typename T
> struct Marshal
{
73 template <typename T
> int Marshal
<T
>::gc() {
75 x
->template shared_ptr
<T
>::~shared_ptr();
85 template<typename T
> struct S
{ int a
; T x
; };
86 template<typename T
> decltype(S
<T
>().~S()) f(); // expected-note {{candidate template ignored: couldn't infer template argument 'T'}}
87 void g() { f(); } // expected-error {{no matching function for call to 'f'}}
93 ~PR33189() { } // expected-error{{destructor cannot be declared as a template}}
99 ~S(); // expected-error{{destructor cannot be declared as a template}}
104 } // namespace PR38671