On Tue, Apr 28, 2020 at 08:30:27PM +0000, Harry Gillanders via 
Digitalmars-d-learn wrote:
> The spec doesn't seem to explicitly mention what happens when the left
> operand of a shift expression is signed and negative. [1]
> But I know that D follows C's semantics for this sort of stuff, and
> the C standard specifies that the result of a negative left operand is
> undefined for `<<`, and implementation-defined for `>>`. [2][3]
[...]

Yes, it's UB.  Don't do it.


T

-- 
One Word to write them all, One Access to find them, One Excel to count them 
all, And thus to Windows bind them. -- Mike Champion

Reply via email to