PR c++/49803
* init.c (sort_mem_initializers): Initialize uses_unions_p here.
(build_field_list): Not here.
From-SVN: r177213
2011-08-02 Jason Merrill <jason@redhat.com>
+ PR c++/49803
+ * init.c (sort_mem_initializers): Initialize uses_unions_p here.
+ (build_field_list): Not here.
+
PR c++/49834
* parser.c (build_range_temp): Split out from...
(cp_convert_range_for): ...here.
{
tree fields;
- *uses_unions_p = 0;
-
/* Note whether or not T is a union. */
if (TREE_CODE (t) == UNION_TYPE)
*uses_unions_p = 1;
tree next_subobject;
VEC(tree,gc) *vbases;
int i;
- int uses_unions_p;
+ int uses_unions_p = 0;
/* Build up a list of initializations. The TREE_PURPOSE of entry
will be the subobject (a FIELD_DECL or BINFO) to initialize. The
+2011-08-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/49803
+ * g++.dg/cpp0x/union5.C: New.
+
2011-08-02 Daniel Kraft <d@domob.eu>
PR fortran/49885
--- /dev/null
+// PR c++/49803
+// { dg-options -std=c++0x }
+
+struct X
+{
+ X() = delete;
+};
+
+union Y
+{
+ // N3291=11-0061 12.6.2/8 says no initialization of
+ // of other variant members (i.e. m_x) should
+ // be performed.
+ Y() : m_char1{ }
+ { }
+
+ struct
+ {
+ char m_char1;
+ };
+
+ X m_x;
+};