https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4131
--- Comment #32 from Jason Merrill <jason at gcc dot gnu.org> --- As previously pointed out, since GCC 4.7, for many classes this is a simple matter of adding "constexpr" to the constructor. With the testcase for bug 84103, I notice that clang does dynamic initialization at -O0 and static initialization at -O1. We could do something similar: if the optimizers know the value of a variable at the end of a global initialization function, they could put that value into that variable statically instead.