Commit 57b52959 by Volker Reichelt Committed by Volker Reichelt

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
parent 6af455d7
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.
......
......@@ -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;
......
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.
// PR c++/27423
// { dg-do compile }
void foo(void = 0); // { dg-error "incomplete type|invalid use" }
void bar() { foo(); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment