From: Marek Polacek Date: Wed, 2 Aug 2017 11:50:16 +0000 (+0000) Subject: re PR c/81289 (ICE in libcpp/line-map.c) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7b6353a7ff5edd28bda30480e304bc02cc05432;p=gcc.git re PR c/81289 (ICE in libcpp/line-map.c) PR c/81289 * c-parser.c (c_parser_unary_expression): Use set_error. * gcc.dg/noncompile/pr81289.c: New test. From-SVN: r250821 --- diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index aff4866d915..c89af1d5776 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,8 +1,13 @@ +2017-08-02 Marek Polacek + + PR c/81289 + * c-parser.c (c_parser_unary_expression): Use set_error. + 2017-07-31 Jan Hubicka Martin Liska * c-typeck.c (c_finish_goto_label): Build gimple predict - stament. + statement. 2017-07-31 Martin Liska diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 16cd3579972..d018fbc5961 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -7099,9 +7099,9 @@ c_parser_unary_expression (c_parser *parser) else { c_parser_error (parser, "expected identifier"); - ret.value = error_mark_node; + ret.set_error (); } - return ret; + return ret; case CPP_KEYWORD: switch (c_parser_peek_token (parser)->keyword) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1910d035c7b..a6d97e861f1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-08-02 Marek Polacek + + PR c/81289 + * gcc.dg/noncompile/pr81289.c: New test. + 2017-08-02 Jakub Jelinek PR c++/81640 diff --git a/gcc/testsuite/gcc.dg/noncompile/pr81289.c b/gcc/testsuite/gcc.dg/noncompile/pr81289.c new file mode 100644 index 00000000000..dd211466718 --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/pr81289.c @@ -0,0 +1,8 @@ +/* PR c/81289 */ +/* { dg-do compile } */ + +int +fn (int mm) +{ + mm == *&& +} /* { dg-error "expected identifier" } */