aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-09-10 19:18:34 -0400
committerMarek Polacek <polacek@redhat.com>2020-09-11 11:17:03 -0400
commit13144466f11036585389a0dc5826bf23d53d5616 (patch)
tree9dfe7bd6076c341c2ab13bdabd9993bca8446ac0 /gcc/cp/parser.c
parent29216f56d002982f10c33056f4b3d7f07e164122 (diff)
downloadgcc-13144466f11036585389a0dc5826bf23d53d5616.zip
gcc-13144466f11036585389a0dc5826bf23d53d5616.tar.gz
gcc-13144466f11036585389a0dc5826bf23d53d5616.tar.bz2
c++: Remove LOOKUP_CONSTINIT.
Since we now have DECL_DECLARED_CONSTINIT_P, we no longer need LOOKUP_CONSTINIT. gcc/cp/ChangeLog: * cp-tree.h (LOOKUP_CONSTINIT): Remove. (LOOKUP_REWRITTEN): Adjust. * decl.c (duplicate_decls): Set DECL_DECLARED_CONSTINIT_P. (check_initializer): Use DECL_DECLARED_CONSTINIT_P instead of LOOKUP_CONSTINIT. (cp_finish_decl): Don't set DECL_DECLARED_CONSTINIT_P. Use DECL_DECLARED_CONSTINIT_P instead of LOOKUP_CONSTINIT. (grokdeclarator): Set DECL_DECLARED_CONSTINIT_P. * decl2.c (grokfield): Don't handle LOOKUP_CONSTINIT. * parser.c (cp_parser_decomposition_declaration): Remove LOOKUP_CONSTINIT handling. (cp_parser_init_declarator): Likewise. * pt.c (tsubst_expr): Likewise. (instantiate_decl): Likewise. * typeck2.c (store_init_value): Use DECL_DECLARED_CONSTINIT_P instead of LOOKUP_CONSTINIT.
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 916ea6c..fed1689 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14096,12 +14096,9 @@ cp_parser_decomposition_declaration (cp_parser *parser,
if (decl != error_mark_node)
{
- int flags = (decl_spec_seq_has_spec_p (decl_specifiers, ds_constinit)
- ? LOOKUP_CONSTINIT : 0);
cp_maybe_mangle_decomp (decl, prev, v.length ());
cp_finish_decl (decl, initializer, non_constant_p, NULL_TREE,
- (is_direct_init ? LOOKUP_NORMAL : LOOKUP_IMPLICIT)
- | flags);
+ (is_direct_init ? LOOKUP_NORMAL : LOOKUP_IMPLICIT));
cp_finish_decomp (decl, prev, v.length ());
}
}
@@ -21018,8 +21015,6 @@ cp_parser_init_declarator (cp_parser* parser,
declarations. */
if (!member_p && decl && decl != error_mark_node && !range_for_decl_p)
{
- int cf = (decl_spec_seq_has_spec_p (decl_specifiers, ds_constinit)
- ? LOOKUP_CONSTINIT : 0);
cp_finish_decl (decl,
initializer, !is_non_constant_init,
asm_specification,
@@ -21028,7 +21023,7 @@ cp_parser_init_declarator (cp_parser* parser,
`explicit' constructor is OK. Otherwise, an
`explicit' constructor cannot be used. */
((is_direct_init || !is_initialized)
- ? LOOKUP_NORMAL : LOOKUP_IMPLICIT) | cf);
+ ? LOOKUP_NORMAL : LOOKUP_IMPLICIT));
}
else if ((cxx_dialect != cxx98) && friend_p
&& decl && TREE_CODE (decl) == FUNCTION_DECL)