https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63191
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Richard Biener from comment #13) > (In reply to Jakub Jelinek from comment #12) > > For the C++ FE, the question here is why we actually emit dynamic > > initialization at all. If constexpr is added to the ctor, then we just emit > > the initializer, but even without the constexpr I'd think that if the ctor > > has empty body and trivial mem initializers and if all arguments of the > > ctors are constants, as an optimization we should handle it as if it was > > declared constexpr. Jason? > > I think there is a PR somewhere suggesting C++ should (for all initializers) > try constexpr evaluation. It's much harder to do this in the middle-end. Note clang++ seems to implement that (i.e. constexpr isn't needed there in order to get a static initializer).