https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65114 --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Libstdc++, libc++ and MSVC all use memcpy for char_traits<char>::copy, so we all have the same undefined behaviour.