From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaTemplate/destructor-template.cpp | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 clang/test/SemaTemplate/destructor-template.cpp (limited to 'clang/test/SemaTemplate/destructor-template.cpp') diff --git a/clang/test/SemaTemplate/destructor-template.cpp b/clang/test/SemaTemplate/destructor-template.cpp new file mode 100644 index 0000000..07beda4 --- /dev/null +++ b/clang/test/SemaTemplate/destructor-template.cpp @@ -0,0 +1,59 @@ +// 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; +} -- cgit v1.2.3