summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/destructor.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp
index 1502f734712..cdcae2e4119 100644
--- a/clang/test/SemaCXX/destructor.cpp
+++ b/clang/test/SemaCXX/destructor.cpp
@@ -105,3 +105,17 @@ namespace test6 {
class B : A<int> { B(); };
B::B() {} // expected-note {{in instantiation of member function 'test6::A<int>::~A' requested here}}
}
+
+// Make sure classes are marked invalid when they have invalid
+// members. This avoids a crash-on-invalid.
+namespace test7 {
+ struct A {
+ ~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
+ };
+ struct B : A {};
+
+ void test() {
+ B *b;
+ b->~B();
+ }
+}
OpenPOWER on IntegriCloud