https://bugs.llvm.org/show_bug.cgi?id=49599
Roman Lebedev <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
CC| |[email protected]
--- Comment #1 from Roman Lebedev <[email protected]> ---
This is indeed UB, and -fsanitize=undefined will tell you about it:
https://godbolt.org/z/79q6s8
example.cpp:4:29: runtime error: signed integer overflow: 2147483647 + 1 cannot
be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior example.cpp:4:29 in
You probably want -fwrapv.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs