https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67214
Xi Ruoyao <ryxi at stu dot xidian.edu.cn> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ryxi at stu dot xidian.edu.cn --- Comment #1 from Xi Ruoyao <ryxi at stu dot xidian.edu.cn> --- For GCC 5/6/7 I can't reproduce this since the target code is in libstdc++.so and there the ubsan can't sanitize them. But it seems a real undefined behaviour. BTW, -Woverflow doesn't warn for this in the building of libstdc++ (or this bug should have been detected and fixed). I think there are still improvements of -Woverflow to do.