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; | ^~~~~~~~~~
I'm not sure whether this branch takes effect.
I could not find codes that takes this block, so I haven't added tests for this.
FWIW, the old interpreter does not have the corresponding warn_integer_constant_overflow generated against overflowing increments.