diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-20 22:41:12 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-20 22:41:12 +0000 |
commit | 76ed9cb1d7398bb721cb9df67b3004c14dae8aa8 (patch) | |
tree | 4a744b0a2b46705165a90160e3dba117b991448f | |
parent | ab3c0a2c879569bb00fa664ebaccf9442c0a9c5f (diff) |
Improve message for bad destructor decl. Per Doug's comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76494 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticParseKinds.td | 2 | ||||
-rw-r--r-- | test/SemaCXX/destructor.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index d55242076a..bf832a53d6 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -139,7 +139,7 @@ def err_unexpected_typedef_ident : Error< "unexpected type name %0: expected identifier">; def err_expected_class_name : Error<"expected class name">; def err_destructor_class_name : Error< - "destructor name must be same as the class name">; + "expected the class name after '~' to name a destructor">; def err_unspecified_vla_size_with_static : Error< "'static' may not be used with an unspecified variable length array size">; diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp index 3cd0dba6c8..e65a097132 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 {{destructor name must be same as the class name}} -~undef(); // expected-error {{destructor name must be same as the 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 { |