c++: TINFO_VAR_DECLARED_CONSTINIT -> DECL_DECLARED_CONSTINIT_P
authorNathan Sidwell <nathan@acm.org>
Thu, 10 Sep 2020 13:53:31 +0000 (06:53 -0700)
committerNathan Sidwell <nathan@acm.org>
Thu, 10 Sep 2020 16:37:37 +0000 (09:37 -0700)
commitf9189e10889379ce9582592926db342109f57324
tree4f7af5a880796e212dedee96f7b2c4ba6e1831ff
parent1c68cf348a28a6bea253d9911e3b94eaeba64acd
c++: TINFO_VAR_DECLARED_CONSTINIT -> DECL_DECLARED_CONSTINIT_P

We need to record whether template function-scopestatic decls are
constinit.  That's currently held on the var's TEMPLATE_INFO data.
But I want to get rid of such decl's template header as they're not
really templates, and they're never instantiated separately from their
containing function's definition.  (Just like auto vars, which don't
get them for instance).

This patch moves the flag into a spare decl_lang_flag.

gcc/cp/
* cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Replace with ...
(DECL_DECLARED_CONSTINIT_P): ... this.
* decl.c (start_decl): No need to retrofit_lang_decl for constinit
flag.
(cp_finish_decl): Use DECL_DECLARED_CONSTINIT_P.
* pt.c (tsubst_decl): No need to handle constinit flag
propagation.
(tsubst_expr): Or here.
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/pt.c