PR c++/48537
* init.c (build_value_init): Handle UNION_TYPE the same.
From-SVN: r172678
+2011-04-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/48537
+ * init.c (build_value_init): Handle UNION_TYPE the same.
+
2011-04-18 Jakub Jelinek <jakub@redhat.com>
PR c++/48632
NULL, type, LOOKUP_NORMAL,
complain),
complain);
- else if (TREE_CODE (type) != UNION_TYPE && TYPE_NEEDS_CONSTRUCTING (type))
+ else if (TYPE_NEEDS_CONSTRUCTING (type))
{
/* This is a class that needs constructing, but doesn't have
a user-provided constructor. So we need to zero-initialize
+2011-04-18 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/union4.C: New.
+
2011-04-18 Jakub Jelinek <jakub@redhat.com>
PR middle-end/48661
--- /dev/null
+// PR c++/48537
+// { dg-options -std=c++0x }
+
+struct SFoo
+{
+ SFoo() =delete; // { dg-error "declared" }
+};
+
+union UFoo // { dg-error "deleted" }
+{
+ SFoo foo;
+};
+
+int main()
+{
+ UFoo(); // { dg-error "deleted" }
+}