re PR c++/27422 (ICE with invalid function argument)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Sat, 6 May 2006 00:19:40 +0000 (00:19 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Sat, 6 May 2006 00:19:40 +0000 (00:19 +0000)
PR c++/27422
* typeck.c (convert_arguments): Return early on args with
invalid types.

* g++.dg/conversion/void1.C: New test.

From-SVN: r113568

gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/conversion/void1.C [new file with mode: 0644]

index f423f4fb4be9a4bccd319330f116f534feb7b5c2..c24ed2aaeeccbfbfa1810bb2abb375972d90c118 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27422
+       * typeck.c (convert_arguments): Return early on args with
+       invalid types.
+
 2006-05-03  Aldy Hernandez  <aldyh@redhat.com>
 
        PR/21391
index 78e3a2b8427f3d82a9289ceee6821f668e9c5a52..7d3bd3a3f82fa431623180a9bb335a7c80310de8 100644 (file)
@@ -2704,7 +2704,7 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags)
       tree type = typetail ? TREE_VALUE (typetail) : 0;
       tree val = TREE_VALUE (valtail);
 
-      if (val == error_mark_node)
+      if (val == error_mark_node || type == error_mark_node)
        return error_mark_node;
 
       if (type == void_type_node)
index c6683a9ac06bb7346d406a5c22552b268ca2145e..500e64aa95080f1d15afa1f394705066cef621a0 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27422
+       * g++.dg/conversion/void1.C: New test.
+
 2006-05-03  Aldy Hernandez  <aldyh@redhat.com>
 
        PR/21391
diff --git a/gcc/testsuite/g++.dg/conversion/void1.C b/gcc/testsuite/g++.dg/conversion/void1.C
new file mode 100644 (file)
index 0000000..120fc0e
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/27422
+// { dg-do compile }
+
+void foo(void i);      // { dg-error "incomplete type|invalid use" }
+void bar() { foo(0); }