aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-09-29 19:53:50 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-09-29 19:53:50 +0200
commit603be0224edf653c1e38229e1d32ed449ffd23bd (patch)
treefcd62b99968f8938843ab7d38f586f9001aece90 /gcc/cp/pt.c
parent7d386d45085cbe472089a8df4a2f033d9d5999a5 (diff)
downloadgcc-603be0224edf653c1e38229e1d32ed449ffd23bd.zip
gcc-603be0224edf653c1e38229e1d32ed449ffd23bd.tar.gz
gcc-603be0224edf653c1e38229e1d32ed449ffd23bd.tar.bz2
P0683R1 - default member initializers for bit-fields
P0683R1 - default member initializers for bit-fields cp/ * cp-tree.h (grokbitfield): Add INIT parameter. * parser.c (cp_parser_constant_expression): Add STRICT_P argument, if true, parse a conditional-expression rather than assignment-expression. (cp_parser_member_declaration): For C++11 and later pass true as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for DECL_C_BIT_FIELDs. (cp_parser_objc_class_ivars): Adjust grokbitfield caller. * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs. (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs. * decl2.c (grokbitfield): Add INIT parameter, pass it to cp_finish_decl. * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not just non-bitfields. testsuite/ * g++.dg/ext/bitfield6.C: New test. * g++.dg/cpp2a/bitfield1.C: New test. * g++.dg/cpp2a/bitfield2.C: New test. * g++.dg/cpp2a/bitfield3.C: New test. From-SVN: r253302
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 70cfc9a..c29c779 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -12841,7 +12841,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
= tsubst_expr (DECL_BIT_FIELD_REPRESENTATIVE (t), args,
complain, in_decl,
/*integral_constant_expression_p=*/true);
- else if (DECL_INITIAL (t))
+ if (DECL_INITIAL (t))
{
/* Set up DECL_TEMPLATE_INFO so that we can get at the
NSDMI in perform_member_init. Still set DECL_INITIAL