Commit 4e3d9146 by Joseph Myers Committed by Joseph Myers

re PR c/20245 (ICE on invalid function declaration)

	PR c/20245
	* c-parser.c (c_parser_compound_statement): Return error_mark_node
	instead of NULL_TREE on error.

testsuite:
	* gcc.dg/pr20245-1.c: New test.

From-SVN: r95693
parent 48d72335
2005-02-28 Joseph S. Myers <joseph@codesourcery.com>
PR c/20245
* c-parser.c (c_parser_compound_statement): Return error_mark_node
instead of NULL_TREE on error.
2005-02-28 David Edelsohn <edelsohn@gnu.org> 2005-02-28 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c (EASY_VECTOR_15): Remove. * config/rs6000/rs6000.c (EASY_VECTOR_15): Remove.
......
...@@ -3170,7 +3170,7 @@ c_parser_compound_statement (c_parser *parser) ...@@ -3170,7 +3170,7 @@ c_parser_compound_statement (c_parser *parser)
{ {
tree stmt; tree stmt;
if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>")) if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>"))
return NULL_TREE; return error_mark_node;
stmt = c_begin_compound_stmt (true); stmt = c_begin_compound_stmt (true);
c_parser_compound_statement_nostart (parser); c_parser_compound_statement_nostart (parser);
return c_end_compound_stmt (stmt, true); return c_end_compound_stmt (stmt, true);
......
2005-02-28 Joseph S. Myers <joseph@codesourcery.com>
PR c/20245
* gcc.dg/pr20245-1.c: New test.
2005-02-28 Jakub Jelinek <jakub@redhat.com> 2005-02-28 Jakub Jelinek <jakub@redhat.com>
PR middle-end/19874 PR middle-end/19874
......
/* Bug 20245: the parse error should not result in an ICE. */
/* { dg-do compile } */
/* { dg-options "" } */
void foo() x; /* { dg-error "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