https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103618
--- Comment #3 from Maik Urbannek <maik.urbannek at cattatech dot de> --- The `constexpr` in the main function is not necessary to produce the warning. The Function foo has to be constexpr. 'inline' or 'static' (before the function) does not produce the warning. Maybe `constexpr` functions have better optimization and in one of the optimizations happens unwanted stuff. I don't think it is an compile-time/run-time issue.