https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99677
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org --- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- As the functions aren't constexpr, they aren't even considered during C++ FE constexpr processing. gnu::const means something completely different. I bet we optimize away static const variables only written (even with non-constant initializers) and never address taken or otherwise used, this PR seems to ask to handle inline const (with the C++ FE specific behavior for them) in such cases too. I'm not sure it is valid if the vars are odr-used somewhere and the odr-uses are later optimized away, I think emitting the inline vars in that case is part of the ABI. And the not odr-used cases which are only used by their initialization is yet another question.