From fe17d2550b84202b599a86e0f4f4f1f4729deb30 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 16 Feb 2010 19:09:40 +0000 Subject: Improve parsing and instantiation of destructor names, so that we can now cope with the destruction of types named as dependent templates, e.g., y->template Y::~Y() Nominally, we implement C++0x [basic.lookup.qual]p6. However, we don't follow the letter of the standard here because that would fail to parse template X0::~X0() { } properly. The problem is captured in core issue 339, which gives some (but not enough!) guidance. I expect to revisit this code when the resolution of 339 is clear, and/or we start capturing better source information for DeclarationNames. Fixes PR6152. llvm-svn: 96367 --- clang/test/SemaCXX/destructor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/test/SemaCXX/destructor.cpp') diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp index 6837cd40157..a0c2c1e037e 100644 --- a/clang/test/SemaCXX/destructor.cpp +++ b/clang/test/SemaCXX/destructor.cpp @@ -40,9 +40,9 @@ struct F { ~F(); // expected-error {{destructor cannot be redeclared}} }; -~; // expected-error {{expected the class name after '~' to name a destructor}} +~; // expected-error {{expected a 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}} +~operator+(int, int); // expected-error {{expected a class name after '~' to name a destructor}} ~F(){} // expected-error {{destructor must be a non-static member function}} struct G { -- cgit v1.2.3