Commit def88a88 by Paolo Carlini Committed by Paolo Carlini

re PR c++/39053 (ICE with broken function declaration)

/cp
2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/39053
	* parser.c (cp_parser_pure_specifier): If there are no tokens left
	do not call cp_lexer_consume_token.

/testsuite
2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/39053
	* g++.dg/parse/crash52.C: New.

From-SVN: r143861
parent 27c40174
2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/39053
* parser.c (cp_parser_pure_specifier): If there are no tokens left
do not call cp_lexer_consume_token.
2009-01-30 Jakub Jelinek <jakub@redhat.com>
PR c++/39028
......
......@@ -15997,7 +15997,13 @@ cp_parser_pure_specifier (cp_parser* parser)
if (!cp_parser_require (parser, CPP_EQ, "%<=%>"))
return error_mark_node;
/* Look for the `0' token. */
token = cp_lexer_consume_token (parser->lexer);
token = cp_lexer_peek_token (parser->lexer);
if (token->type == CPP_EOF
|| token->type == CPP_PRAGMA_EOL)
return error_mark_node;
cp_lexer_consume_token (parser->lexer);
/* Accept = default or = delete in c++0x mode. */
if (token->keyword == RID_DEFAULT
......
2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/39053
* g++.dg/parse/crash52.C: New.
2009-01-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39041
......
// PR c++/39053
void foo() = // { dg-error "initialized|expected" }
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