Commit 32da2be4 by Jason Merrill Committed by Jason Merrill

re PR c++/47277 ([C++0x] pseudo destructor code that cause an internal compiler…

re PR c++/47277 ([C++0x] pseudo destructor code that cause an internal compiler error with std=gnu++0x)

	PR c++/47277
	* parser.c (cp_parser_pseudo_destructor_name): Commit to parse
	after we see the ~.

From-SVN: r174385
parent b8d85086
2011-05-27 Jason Merrill <jason@redhat.com>
PR c++/47277
* parser.c (cp_parser_pseudo_destructor_name): Commit to parse
after we see the ~.
* mangle.c (mangle_decl_string): Make sure we don't try to mangle
templates.
......
......@@ -5642,6 +5642,11 @@ cp_parser_pseudo_destructor_name (cp_parser* parser,
/* Look for the `~'. */
cp_parser_require (parser, CPP_COMPL, RT_COMPL);
/* Once we see the ~, this has to be a pseudo-destructor. */
if (!processing_template_decl && !cp_parser_error_occurred (parser))
cp_parser_commit_to_tentative_parse (parser);
/* Look for the type-name again. We are not responsible for
checking that it matches the first type-name. */
*type = cp_parser_nonclass_name (parser);
......
2011-05-27 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/enum18.C: Adjust.
* g++.dg/cpp0x/lambda/lambda-template2.C: New.
2011-05-27 Tobias Burnus <burnus@net-b.de>
......
......@@ -2,7 +2,7 @@
// { dg-options -std=c++0x }
int main(void) {
enum e {};
e ev;
ev.e::~e_u(); // { dg-error "" }
enum e {};
e ev;
ev.e::~e_u(); // { dg-error "e_u. has not been declared" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment