summaryrefslogtreecommitdiff
path: root/test/SemaCXX/destructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/destructor.cpp')
-rw-r--r--test/SemaCXX/destructor.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp
index f544db0b1b6e..790a401ae99c 100644
--- a/test/SemaCXX/destructor.cpp
+++ b/test/SemaCXX/destructor.cpp
@@ -40,8 +40,9 @@ struct F {
~F(); // expected-error {{destructor cannot be redeclared}}
};
-~; // expected-error {{expected class name}}
-~undef(); // expected-error {{expected class name}}
+~; // expected-error {{expected the class name after '~' to name a destructor}}
+~undef(); // expected-error {{expected the class name after '~' to name a destructor}}
+~operator+(int, int); // expected-error {{expected the class name after '~' to name a destructor}}
~F(){} // expected-error {{destructor must be a non-static member function}}
struct G {
@@ -54,3 +55,9 @@ G::~G() { }
struct H {
~H(void) { }
};
+
+struct X {};
+
+struct Y {
+ ~X(); // expected-error {{expected the class name after '~' to name the enclosing class}}
+};