Commit 0fa367aa by Jason Merrill Committed by Jason Merrill

PR c++/80605 - __is_standard_layout and zero-length array

	* class.c (check_bases): Use DECL_FIELD_IS_BASE.

From-SVN: r248470
parent 87c976ae
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.
......@@ -727,6 +732,7 @@
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
......
......@@ -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;
......
// { 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), "");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment