[clang][Diagnostics] Provide source range to integer-overflow warnings
BEFORE: ``` overflow.cpp:1:21: warning: overflow in expression; result is -2147483648 with type 'int' [-Winteger-overflow] 1 | int x = __INT_MAX__ + 1 + 3; | ^ overflow.cpp:2:9: warning: overflow in expression; result is -2147483648 with type 'int' [-Winteger-overflow] 2 | int a = -(1 << 31) + 1; | ^ ``` AFTER: ``` overflow.cpp:1:21: warning: overflow in expression; result is -2147483648 with type 'int' [-Winteger-overflow] 1 | int x = __INT_MAX__ + 1 + 3; | ~~~~~~~~~~~~^~~ overflow.cpp:2:9: warning: overflow in expression; result is -2147483648 with type 'int' [-Winteger-overflow] 2 | int a = -(1 << 31) + 1; | ^~~~~~~~~~ ``` Reviewed By: tbaeder Differential Revision: https://reviews.llvm.org/D157383
Loading
Please sign in to comment