* class.c (check_bases): Use DECL_FIELD_IS_BASE.
From-SVN: r248470
+2017-05-25 Jason Merrill <jason@redhat.com>
+
+ PR c++/80605 - __is_standard_layout and zero-length array
+ * class.c (check_bases): Use DECL_FIELD_IS_BASE.
+
2017-05-25 Nathan Sidwell <nathan@acm.org>
Kill OVL_CURRENT, OVL_NEXT.
2017-05-09 Jason Merrill <jason@redhat.com>
+ PR c++/80605 - __is_standard_layout and empty base
* class.c (check_bases): Ignore empty bases.
PR c++/70979 - literal class and closure types
for (basefield = TYPE_FIELDS (basetype); basefield;
basefield = DECL_CHAIN (basefield))
if (TREE_CODE (basefield) == FIELD_DECL
- && DECL_SIZE (basefield)
- && !integer_zerop (DECL_SIZE (basefield)))
+ && !(DECL_FIELD_IS_BASE (basefield)
+ && integer_zerop (DECL_SIZE (basefield))))
{
if (field)
CLASSTYPE_NON_STD_LAYOUT (t) = 1;
--- /dev/null
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+struct S { int a[0]; };
+struct T : public S { int b[0]; int c; };
+static_assert(!__is_standard_layout (T), "");