peterzheng98/Compiler-2020

Negative Operands for Shift Left/Right Operator

Closed this issue · 1 comments

Hi! Is the operation undefined if any of the operands is a negative number in shift left/right operator?

For example, both -1 << 1 and 1 << -1 are undefined behaviors.

I think this should be undefined.

Thanks!

Yes, they are undefined.