summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/destructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/destructor.cpp')
-rw-r--r--clang/test/SemaCXX/destructor.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp
index c66ec9f2c75..60cb0ef0908 100644
--- a/clang/test/SemaCXX/destructor.cpp
+++ b/clang/test/SemaCXX/destructor.cpp
@@ -392,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