-32768 is promoted to a signed int (a negative value).
Right-shift on signed integral types is an arithmetic right shift, which performs sign-extension.
Ideally, do not perform bit-wise shift operations on signed integer types.
I understand how t2 showed up, what I dont understand is t1 is supposed to be the same as t2, its signed and given the value of -32768, why the shift is normal instead of arithmetic?
C++17: The value of E1 >> E2 is E1 right-shifted E2 bit positions. ... If E1 has
a signed type and a negative value, the resulting value is implementation-defined.
C++20: E1 is right-shifted E2 bit positions. Right-shift on signed integral types is an arithmetic right shift, which performs sign-extension.