summaryrefslogtreecommitdiff
path: root/test/SemaCXX/destructor.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit3d1dcd9bfdb15c49ee34d576a065079ac5c4d29f (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/SemaCXX/destructor.cpp
parenta0482fa4e7fa27b01184f938097f0666b78016dd (diff)
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r--test/SemaCXX/destructor.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp
index 4f6c76bc90eda..cdcae2e4119e8 100644
--- a/test/SemaCXX/destructor.cpp
+++ b/test/SemaCXX/destructor.cpp
@@ -103,5 +103,19 @@ namespace test6 {
};
class B : A<int> { B(); };
- B::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();
+ }
}