@@ -4005,11 +4005,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
gimplify_stmt (expr_p, pre_p);
}
- /* If we have not block cleared the object, or if there are nonzero
- elements in the constructor, add assignments to the individual
- scalar fields of the object. */
- if (!cleared || num_nonzero_elements > 0)
- gimplify_init_ctor_eval (object, elts, pre_p, cleared);
+ gimplify_init_ctor_eval (object, elts, pre_p, cleared);
*expr_p = NULL_TREE;
}
new file mode 100644
@@ -0,0 +1,21 @@
+// { dg-do run { target c++11 } }
+
+static int g;
+
+struct A {
+ A() { g = 1; }
+};
+
+struct accessor {
+ A a;
+ int x;
+};
+
+int
+main (void)
+{
+ (void) accessor{};
+
+ if (g != 1)
+ __builtin_abort ();
+}