re PR c/54355 (ICE on invalid code in switch statement)

PR c/54355
	* c-decl.c (c_parser_label): Pass true as nested and fix up comments
	for nested and empty_ok arguments in the call to
	c_parser_declaration_or_fndef.

	* gcc.dg/pr54355.c: New test.

From-SVN: r190656
This commit is contained in:
Jakub Jelinek 2012-08-24 23:45:22 +02:00 committed by Jakub Jelinek
parent 12fdc0990f
commit 6265d07ce0
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2012-08-24 Jakub Jelinek <jakub@redhat.com>
PR c/54355
* c-decl.c (c_parser_label): Pass true as nested and fix up comments
for nested and empty_ok arguments in the call to
c_parser_declaration_or_fndef.
2012-08-17 Jakub Jelinek <jakub@redhat.com>
* c-tree.h (c_last_sizeof_arg): Declare.

View File

@ -4327,7 +4327,7 @@ c_parser_label (c_parser *parser)
"a declaration is not a statement");
c_parser_declaration_or_fndef (parser, /*fndef_ok*/ false,
/*static_assert_ok*/ true,
/*nested*/ true, /*empty_ok*/ false,
/*empty_ok*/ true, /*nested*/ true,
/*start_attr_ok*/ true, NULL);
}
}

View File

@ -1,3 +1,8 @@
2012-08-24 Jakub Jelinek <jakub@redhat.com>
PR c/54355
* gcc.dg/pr54355.c: New test.
2012-08-24 H.J. Lu <hongjiu.lu@intel.com>
PR debug/52857

View File

@ -0,0 +1,11 @@
/* PR c/54355 */
/* { dg-do compile } */
void
foo (int i)
{
switch (i)
{
case 0: T x > /* { dg-error "(label|unknown type|expected)" } */
}
} /* { dg-error "expected" } */