PR c++/70259
* decl.c (start_preparsed_function): Don't clobber an empty base.
From-SVN: r234267
+2016-03-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/70259
+ * decl.c (start_preparsed_function): Don't clobber an empty base.
+
2016-03-16 Jakub Jelinek <jakub@redhat.com>
PR c++/70147
&& (flag_lifetime_dse > 1)
&& DECL_CONSTRUCTOR_P (decl1)
&& !DECL_CLONED_FUNCTION_P (decl1)
+ /* Clobbering an empty base is harmful if it overlays real data. */
+ && !is_empty_class (current_class_type)
/* We can't clobber safely for an implicitly-defined default constructor
because part of the initialization might happen before we enter the
constructor, via AGGR_INIT_ZERO_FIRST (c++/68006). */
--- /dev/null
+// PR c++/70259
+// { dg-options -O2 }
+// { dg-do run }
+
+struct Empty { };
+struct A { A() : a(true) { } bool a; };
+struct B : Empty { B() : Empty() { } };
+struct C : A, B { C() : A(), B() { } };
+int main() {
+ C c;
+ if ( c.a == false )
+ __builtin_abort();
+};