mirror of git://gcc.gnu.org/git/gcc.git
re PR c/71853 (ICE on an ill-formed case statement in c_do_switch_warnings)
PR c/71853 * c-parser.c (c_parser_switch_statement): Initialize ce.original_type to error node for invalid code. * gcc.dg/noncompile/pr71853.c: New test. From-SVN: r238884
This commit is contained in:
parent
f618a47208
commit
efd0786f21
|
|
@ -3,6 +3,10 @@
|
|||
PR c/71742
|
||||
* c-decl.c (finish_struct): Rephrase an error message.
|
||||
|
||||
PR c/71853
|
||||
* c-parser.c (c_parser_switch_statement): Initialize ce.original_type
|
||||
to error node for invalid code.
|
||||
|
||||
2016-07-29 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c/71969
|
||||
|
|
|
|||
|
|
@ -5661,6 +5661,7 @@ c_parser_switch_statement (c_parser *parser, bool *if_p)
|
|||
{
|
||||
switch_cond_loc = UNKNOWN_LOCATION;
|
||||
expr = error_mark_node;
|
||||
ce.original_type = error_mark_node;
|
||||
}
|
||||
c_start_case (switch_loc, switch_cond_loc, expr, explicit_cast_p);
|
||||
save_break = c_break_label;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
* gcc.dg/c99-flex-array-1.c: Likewise.
|
||||
* gcc.dg/c99-flex-array-typedef-1.c: Likewise.
|
||||
|
||||
PR c/71853
|
||||
* gcc.dg/noncompile/pr71853.c: New test.
|
||||
|
||||
2016-07-29 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* gcc.dg/pr59833.c: Use dg-add-options ieee.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
/* PR c/71853 */
|
||||
/* { dg-do compile } */
|
||||
|
||||
void f (void)
|
||||
{
|
||||
case (0) { /* { dg-error "expected" } */
|
||||
switch 0: { } /* { dg-error "expected" } */
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue