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

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

From-SVN: r113570

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

index 11fc298cc1e16436036d94d27dbfd471073ed8f6..b3467f52f15dc74ac2a037ddbaccbcc7650ff991 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-04-30  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27278
index f221d23d1b7984853ea1a789088ed70f4b10f9ed..1c60dc43d91bb6dfad955c9f404300cde2305fb3 100644 (file)
@@ -2569,7 +2569,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 652e76b3fe063bc77241373a0d66ad47e55d3c61..f2c20ddd4a3e2b4b6c3a13a4cb21393e137208b7 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  Roger Sayle  <roger@eyesopen.com>
 
        PR c/25309
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); }