2017-05-09 Jason Merrill <jason@redhat.com>
+ * class.c (check_bases): Ignore empty bases.
+
PR c++/70979 - literal class and closure types
* class.c (finalize_literal_type_property): Handle closures
specifically.
members */
for (basefield = TYPE_FIELDS (basetype); basefield;
basefield = DECL_CHAIN (basefield))
- if (TREE_CODE (basefield) == FIELD_DECL)
+ if (TREE_CODE (basefield) == FIELD_DECL
+ && DECL_SIZE (basefield)
+ && !integer_zerop (DECL_SIZE (basefield)))
{
if (field)
CLASSTYPE_NON_STD_LAYOUT (t) = 1;
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+template <int> struct E { };
+
+struct E1: E<0>, E<1> { };
+struct E2: E<2>, E<3> { };
+
+struct A1x { int n; };
+struct D2: A1x, E1, E2 { };
+
+#define SA(X) static_assert((X),#X)
+SA(__is_standard_layout (D2));