https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141
--- Comment #4 from Nikl Kelbon <kelbonage at gmail dot com> --- (In reply to Sam James from comment #3) > (In reply to Nikl Kelbon from comment #2) > > This is not a bug about the difference in behavior of different compilers. > > Of course they will behave the same, they have the same standard libraries > > and sanitizers. > > No, it's not an "of course" at all. While libsanitizer is shared, the > instrumentation is done in the compiler itself, and even with that aside, > optimisations can affect opportunities for instrumentation. > > As for standard libraries: also no, as Andrew's example shows using > -stdlib=libc++ (rather than libstdc++). Okay, but did standard really allows this code to be undefined behavior in implicit conversion?