summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/destructor.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
committerdim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
commit3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch)
treedbbd4047878da71c1a706e26ce05b4e7791b14cc /test/SemaCXX/destructor.cpp
parent38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff)
downloadFreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip
FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r--test/SemaCXX/destructor.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp
index 5305ff5..60cb0ef 100644
--- a/test/SemaCXX/destructor.cpp
+++ b/test/SemaCXX/destructor.cpp
@@ -173,6 +173,12 @@ protected:
~S7();
};
+struct S8 {} s8;
+
+UnknownType S8::~S8() { // expected-error {{unknown type name 'UnknownType'}}
+ s8.~S8();
+}
+
template<class T> class TS : public B {
virtual void m();
};
@@ -386,3 +392,14 @@ struct S {
volatile ~S() { } // expected-error{{destructor cannot have a return type}}
};
}
+
+namespace PR22668 {
+struct S {
+};
+void f(S s) {
+ (s.~S)();
+}
+void g(S s) {
+ (s.~S); // expected-error{{reference to destructor must be called}}
+}
+}
OpenPOWER on IntegriCloud