re PR c/81289 (ICE in libcpp/line-map.c)
authorMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 2 Aug 2017 11:50:16 +0000 (11:50 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 2 Aug 2017 11:50:16 +0000 (11:50 +0000)
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
gcc/c/c-parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/noncompile/pr81289.c [new file with mode: 0644]

index aff4866d91583241740bccd5ceb740a13b00f18b..c89af1d57762bc411c1f22355839c038028c0e28 100644 (file)
@@ -1,8 +1,13 @@
+2017-08-02  Marek Polacek  <polacek@redhat.com>
+
+       PR c/81289
+       * c-parser.c (c_parser_unary_expression): Use set_error.
+
 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
            Martin Liska  <mliska@suse.cz>
 
        * c-typeck.c (c_finish_goto_label): Build gimple predict
-       stament.
+       statement.
 
 2017-07-31  Martin Liska  <mliska@suse.cz>
 
index 16cd3579972917994115657bc0511d619baddd88..d018fbc59612065e482fc309d120f597cac64632 100644 (file)
@@ -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)
        {
index 1910d035c7baf1b5457add67555a773e78bf2e58..a6d97e861f15e62a752fd97680cfd7940510c85e 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-02  Marek Polacek  <polacek@redhat.com>
+
+       PR c/81289
+       * gcc.dg/noncompile/pr81289.c: New test.
+
 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..dd21146
--- /dev/null
@@ -0,0 +1,8 @@
+/* PR c/81289 */
+/* { dg-do compile } */
+
+int
+fn (int mm)
+{
+  mm == *&&
+} /* { dg-error "expected identifier" } */