From f7b6353a7ff5edd28bda30480e304bc02cc05432 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Wed, 2 Aug 2017 11:50:16 +0000 Subject: [PATCH] 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 --- gcc/c/ChangeLog | 7 ++++++- gcc/c/c-parser.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/noncompile/pr81289.c | 8 ++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/noncompile/pr81289.c 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" } */ -- 2.30.2