diff options
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r-- | test/SemaCXX/destructor.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp index 4f6c76b..cdcae2e 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(); + } } |