Commit e5dda971 by Jason Merrill Committed by Jason Merrill

re PR c++/48569 (internal compiler error: in build_zero_init_1, at cp/init.c:278)

	PR c++/48569
	* typeck2.c (build_functional_cast): Handle VOID_TYPE.

From-SVN: r172680
parent 09262fff
2011-04-18 Jason Merrill <jason@redhat.com>
PR c++/48569
* typeck2.c (build_functional_cast): Handle VOID_TYPE.
PR c++/48537
* init.c (build_value_init): Handle UNION_TYPE the same.
......
......@@ -1566,7 +1566,11 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
if (! MAYBE_CLASS_TYPE_P (type))
{
if (parms == NULL_TREE)
return build_value_init (type, complain);
{
if (VOID_TYPE_P (type))
return void_zero_node;
return build_value_init (type, complain);
}
/* This must build a C cast. */
parms = build_x_compound_expr_from_list (parms, ELK_FUNC_CAST, complain);
......
2011-04-18 Jason Merrill <jason@redhat.com>
* g++.dg/init/void1.C: New.
* g++.dg/cpp0x/union4.C: New.
2011-04-18 Jakub Jelinek <jakub@redhat.com>
......
// PR c++/48569
int main()
{
void();
}
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