https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87494
Nathan Froyd <froydnj at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID |--- --- Comment #4 from Nathan Froyd <froydnj at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > I don't think this is techincally a bug. It might be a missed optimization > but not a bug. You still need a definition even for constexpr if used > outside of a constexpr usage IIRC. You can only use `constexpr` on variable definitions, not declarations. So I already have a definition, and I can't imagine where another one should be added. FWIW, clang and MSVC both accept this code without problems.