mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-09 03:00:27 +08:00
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
This commit is contained in:
parent
f3eb9681f0
commit
f007042e20
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
* doc/invoke.texi (-fira): Remove.
|
||||
|
@ -2578,6 +2578,7 @@ c_parser_parms_list_declarator (c_parser *parser, tree attrs)
|
||||
"expected %<;%>, %<,%> or %<)%>"))
|
||||
{
|
||||
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
|
||||
get_pending_sizes ();
|
||||
return NULL;
|
||||
}
|
||||
if (c_parser_next_token_is (parser, CPP_ELLIPSIS))
|
||||
@ -2605,6 +2606,7 @@ c_parser_parms_list_declarator (c_parser *parser, tree attrs)
|
||||
{
|
||||
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
|
||||
"expected %<)%>");
|
||||
get_pending_sizes ();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
PR c++/38950
|
||||
|
3
gcc/testsuite/gcc.dg/noncompile/pr35444-1.c
Normal file
3
gcc/testsuite/gcc.dg/noncompile/pr35444-1.c
Normal file
@ -0,0 +1,3 @@
|
||||
/* 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() {}
|
4
gcc/testsuite/gcc.dg/noncompile/pr35444-2.c
Normal file
4
gcc/testsuite/gcc.dg/noncompile/pr35444-2.c
Normal file
@ -0,0 +1,4 @@
|
||||
/* 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() {}
|
Loading…
x
Reference in New Issue
Block a user