aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/typeck2.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-10-14 17:54:39 -0400
committerJason Merrill <jason@gcc.gnu.org>2016-10-14 17:54:39 -0400
commitec2416b5fff0e603e94ee98c1042003812847b59 (patch)
tree20dc5c1492c844c3ef6699033ebb18974cd22f91 /gcc/cp/typeck2.c
parentefc5aa6bc7c686b302c5d7fd7f65e3f6361961e1 (diff)
downloadgcc-ec2416b5fff0e603e94ee98c1042003812847b59.zip
gcc-ec2416b5fff0e603e94ee98c1042003812847b59.tar.gz
gcc-ec2416b5fff0e603e94ee98c1042003812847b59.tar.bz2
Implement P0017R1, C++17 aggregates with bases.
* class.c (build_base_field_1): Split out from... (build_base_field): ...here. In C++17 mode, build a field for empty bases. * decl.c (xref_basetypes): In C++17 aggregates can have bases. (next_initializable_field): Allow base fields in C++17. * typeck2.c (process_init_constructor_record): Likewise. From-SVN: r241187
Diffstat (limited to 'gcc/cp/typeck2.c')
-rw-r--r--gcc/cp/typeck2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 121da32..022a478 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1352,6 +1352,7 @@ process_init_constructor_record (tree type, tree init,
gcc_assert (TREE_CODE (type) == RECORD_TYPE);
gcc_assert (!CLASSTYPE_VBASECLASSES (type));
gcc_assert (!TYPE_BINFO (type)
+ || cxx_dialect >= cxx1z
|| !BINFO_N_BASE_BINFOS (TYPE_BINFO (type)));
gcc_assert (!TYPE_POLYMORPHIC_P (type));
@@ -1369,7 +1370,9 @@ process_init_constructor_record (tree type, tree init,
if (!DECL_NAME (field) && DECL_C_BIT_FIELD (field))
continue;
- if (TREE_CODE (field) != FIELD_DECL || DECL_ARTIFICIAL (field))
+ if (TREE_CODE (field) != FIELD_DECL
+ || (DECL_ARTIFICIAL (field)
+ && !(cxx_dialect >= cxx1z && DECL_FIELD_IS_BASE (field))))
continue;
/* If this is a bitfield, first convert to the declared type. */