re PR c++/27423 (ICE on default argument for void parameter)

PR c++/27423
	* typeck.c (convert_for_initialization): Skip erroneous types.

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

From-SVN: r113571
This commit is contained in:
Volker Reichelt 2006-05-06 00:32:27 +00:00 committed by Volker Reichelt
parent 6af455d712
commit 57b529596a
4 changed files with 13 additions and 1 deletions

View 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.

View 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;

View 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.

View File

@ -0,0 +1,5 @@
// PR c++/27423
// { dg-do compile }
void foo(void = 0); // { dg-error "incomplete type|invalid use" }
void bar() { foo(); }