https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107174
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- -fsanitize=undefined catches this at runtime: /app/example.cpp:10:28: runtime error: signed integer overflow: 2000000000 - -1000000000 cannot be represented in type 'int' /app/example.cpp:7:28: runtime error: signed integer overflow: 2000000000 - -1000000000 cannot be represented in type 'int'