OSDN Git Service

PR c++/27423
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 May 2006 00:32:27 +0000 (00:32 +0000)
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 May 2006 00:32:27 +0000 (00:32 +0000)
* typeck.c (convert_for_initialization): Skip erroneous types.

* g++.dg/other/void2.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113571 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c24ed2a..31e40de 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/27423
+       * typeck.c (convert_for_initialization): Skip erroneous types.
+
        PR c++/27422
        * typeck.c (convert_arguments): Return early on args with
        invalid types.
index 7d3bd3a..3eeb837 100644 (file)
@@ -6219,7 +6219,8 @@ convert_for_initialization (tree exp, tree type, tree rhs, int flags,
       && codel != REFERENCE_TYPE)
     rhs = TREE_OPERAND (rhs, 0);
 
-  if (rhs == error_mark_node
+  if (type == error_mark_node
+      || rhs == error_mark_node
       || (TREE_CODE (rhs) == TREE_LIST && TREE_VALUE (rhs) == error_mark_node))
     return error_mark_node;
 
index 500e64a..a51b52d 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/27423
+       * g++.dg/other/void2.C: New test.
+
        PR c++/27422
        * g++.dg/conversion/void1.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/other/void2.C b/gcc/testsuite/g++.dg/other/void2.C
new file mode 100644 (file)
index 0000000..153e0f1
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/27423
+// { dg-do compile }
+
+void foo(void = 0);    // { dg-error "incomplete type|invalid use" }
+void bar() { foo(); }