Commit 6265d07c by Jakub Jelinek Committed by Jakub Jelinek

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
parent 12fdc099
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.
......
......@@ -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);
}
}
......
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
......
/* 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" } */
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