https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88925
--- Comment #2 from Domani Hannes <ssbssa at yahoo dot de> --- (In reply to Richard Biener from comment #1) > It works for me on x86_64-linux. Note to get the desired behavior GCC > relies on > string-merging performed by the linker. > > Can you elaborate on the host/target you compile for? It's for x86_64-w64-mingw32. I thought string-merging is only for the case when the same string literal is used in multiple locations. But here "Derived1" is only used once for typeDerived1, which Derived1::getType() then returns. So I never would have thought that Derived1::getType() could be different to typeDerived1, which it is. Am I depending on undefined behavior? If yes, why?