Skip to content

Commit

Permalink
Issue 4887 - Right-shifting by 32 is allowed and broken
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jan 24, 2012
1 parent c58bfae commit 93e8828
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions expression.dd
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,20 @@ $(GNAME ShiftExpression):
$(I ShiftExpression) $(B >>>) $(GLINK AddExpression)
)

The operands must be integral types, and undergo the usual integral
$(P The operands must be integral types, and undergo the usual integral
promotions. The result type is the type of the left operand after
the promotions. The result value is the result of shifting the bits
by the right operand's value.
<p>
)

$(B &lt;&lt;) is a left shift.
$(P $(B &lt;&lt;) is a left shift.
$(B &gt;&gt;) is a signed right shift.
$(B &gt;&gt;&gt;) is an unsigned right shift.
<p>
)

It's illegal to shift by more bits than the size of the
$(P It's illegal to shift by the same or more bits than the size of the
quantity being shifted:
)

-------------
int c;
Expand Down

0 comments on commit 93e8828

Please sign in to comment.