Commit f007042e by Joseph Myers Committed by Joseph Myers

re PR c/35444 (ICE with invalid function declaration)

	PR c/35444
	* c-parser.c (c_parser_parms_list_declarator): Discard pending
	sizes on syntax error after some arguments have been parsed.

testsuite:
	* gcc.dg/noncompile/pr35444-1.c, gcc.dg/noncompile/pr35444-2.c:
	New tests.

From-SVN: r144149
parent f3eb9681
2009-02-13 Joseph Myers <joseph@codesourcery.com>
PR c/35444
* c-parser.c (c_parser_parms_list_declarator): Discard pending
sizes on syntax error after some arguments have been parsed.
2009-02-12 Jakub Jelinek <jakub@redhat.com> 2009-02-12 Jakub Jelinek <jakub@redhat.com>
* doc/invoke.texi (-fira): Remove. * doc/invoke.texi (-fira): Remove.
......
...@@ -2578,6 +2578,7 @@ c_parser_parms_list_declarator (c_parser *parser, tree attrs) ...@@ -2578,6 +2578,7 @@ c_parser_parms_list_declarator (c_parser *parser, tree attrs)
"expected %<;%>, %<,%> or %<)%>")) "expected %<;%>, %<,%> or %<)%>"))
{ {
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL); c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
get_pending_sizes ();
return NULL; return NULL;
} }
if (c_parser_next_token_is (parser, CPP_ELLIPSIS)) if (c_parser_next_token_is (parser, CPP_ELLIPSIS))
...@@ -2605,6 +2606,7 @@ c_parser_parms_list_declarator (c_parser *parser, tree attrs) ...@@ -2605,6 +2606,7 @@ c_parser_parms_list_declarator (c_parser *parser, tree attrs)
{ {
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
"expected %<)%>"); "expected %<)%>");
get_pending_sizes ();
return NULL; return NULL;
} }
} }
......
2009-02-13 Joseph Myers <joseph@codesourcery.com>
PR c/35444
* gcc.dg/noncompile/pr35444-1.c, gcc.dg/noncompile/pr35444-2.c:
New tests.
2009-02-12 Jason Merrill <jason@redhat.com> 2009-02-12 Jason Merrill <jason@redhat.com>
PR c++/38950 PR c++/38950
......
/* PR 35444: ICE from pending VLA sizes in invalid parameter list. */
void foo(int n, int a[n], int 0); /* { dg-error "expected" } */
void bar() {}
/* PR 35444: ICE from pending VLA sizes in invalid parameter list.
Similar case to the PR, but with "..." before the syntax error. */
void foo(int n, int a[n], ... 0); /* { dg-error "expected" } */
void bar() {}
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