https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53181
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> --- The difference between the namespace- and class-scope cases is that the global declarations are known to be defined, while the static members don't have a visible out-of-class definition, and the middle end thinks it can't assume that two symbols defined elsewhere won't turn out to have the same address. Adding definitions of the static members causes the two cases to get the same result. constexpr char Test::wrong_string[]; constexpr char Test::right_string[]; We should probably override the middle end in this case.