diff options
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r-- | test/SemaCXX/destructor.cpp | 17 |
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}} +} +} |