PR c++/48569
* typeck2.c (build_functional_cast): Handle VOID_TYPE.
From-SVN: r172680
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.
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>
--- /dev/null
+// PR c++/48569
+
+int main()
+{
+ void();
+}