diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 5e20cdd81c44a443562a09007668ffdf76c455af (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/SemaCXX/destructor.cpp | |
parent | d5f23b0b7528b5c3caed1ba14f897cc4aaa9e3c3 (diff) |
Notes
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 5305ff5f7ca6..60cb0ef09089 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}} +} +} |