* class.c (check_bases): Ignore empty bases.
From-SVN: r247816
This commit is contained in:
parent
824c3184d7
commit
c0aad6778c
@ -1,5 +1,7 @@
|
||||
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.
|
||||
|
@ -1860,7 +1860,9 @@ check_bases (tree t,
|
||||
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;
|
||||
|
12
gcc/testsuite/g++.dg/ext/is_std_layout1.C
Normal file
12
gcc/testsuite/g++.dg/ext/is_std_layout1.C
Normal file
@ -0,0 +1,12 @@
|
||||
// { 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));
|
Loading…
x
Reference in New Issue
Block a user