[Bug c++/92134] static constinit members incorrectly compile
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 24 22:08:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92134
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Untested fix:
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -990,6 +990,9 @@ grokfield (const cp_declarator *declarator,
else
flags = LOOKUP_IMPLICIT;
+ if (decl_spec_seq_has_spec_p (declspecs, ds_constinit))
+ flags |= LOOKUP_CONSTINIT;
+
switch (TREE_CODE (value))
{
case VAR_DECL:
More information about the Gcc-bugs
mailing list