@@ -1842,8 +1842,8 @@ check_bases (tree t,
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;
new file mode 100644
@@ -0,0 +1,6 @@
+// { 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), "");