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: