Not as natural as you might think: Arithmetic operators - cppreference.com
if the value of the right operand is negative or is greater or equal to the number of bits in the promoted left operand, the behavior is undefined.
I'm not saying compiler bugs are impossible, but they are extremely unlikely, especially with such a trivial piece of code.