https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99162
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Zhang Haibin from comment #0) > $ g++ --version > g++ (GCC) 4.9.2 This compiler is ancient and we're not interested in bug reports for it. If you use a modern compiler you can use -fsanitize=undefined to find bugs like this integer overflow problem.