re PR c/64778 (ICE on invalid code on x86_64-linux-gnu: tree check: expected class...
authorJakub Jelinek <jakub@redhat.com>
Mon, 26 Jan 2015 21:32:09 +0000 (22:32 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 26 Jan 2015 21:32:09 +0000 (22:32 +0100)
PR c/64778
* c-typeck.c (convert_arguments): Return -1 if there are
error_args, even if we've diagnosed too many arguments.

* gcc.dg/pr64778.c: New test.

From-SVN: r220138

gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr64778.c [new file with mode: 0644]

index 33cc2bd3a20326bf1960e6e8d821ebab8658ac51..f361e7cb77f589efea5382f3be0f694316aa8a8e 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/64778
+       * c-typeck.c (convert_arguments): Return -1 if there are
+       error_args, even if we've diagnosed too many arguments.
+
 2015-01-21  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/64313
index f39dfdd9aaee50c935964212ce616c0a856b90e2..09b1bdf389386480dc77ffb2e0e2f40e59937751 100644 (file)
@@ -3143,7 +3143,7 @@ convert_arguments (location_t loc, vec<location_t> arg_loc, tree typelist,
          else
            error_at (loc, "too many arguments to function %qE", function);
          inform_declaration (fundecl);
-         return parmnum;
+         return error_args ? -1 : (int) parmnum;
        }
 
       if (selector && argnum > 2)
index 64162b05604836cca55c47448a28cf195822a061..26d82acbf2e76595d9480f2078be01750fea68e4 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/64778
+       * gcc.dg/pr64778.c: New test.
+
 2015-01-26  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/64421
diff --git a/gcc/testsuite/gcc.dg/pr64778.c b/gcc/testsuite/gcc.dg/pr64778.c
new file mode 100644 (file)
index 0000000..71a2607
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR c/64778 */
+/* { dg-do compile } */
+
+int
+foo (int p)
+{
+  int a;
+  a ^= foo (,);        /* { dg-error "expected expression before|too many arguments" } */
+  return a;
+}