File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -779,13 +779,21 @@ $(GNAME ShiftExpression):
779
779
$(LI $(D >)$(D >)$(D >) is an unsigned right shift.)
780
780
)
781
781
782
- $(P It's illegal to shift by the same or more bits than the size of the
783
- quantity being shifted:)
782
+ $(IMPLEMENTATION_DEFINED
783
+ The result of a shift by a negative value or by the same or more bits
784
+ than the size of the quantity being shifted is undefined.
785
+ When the shift amount is known at compile time, doing this results in
786
+ a compile error.
784
787
785
788
-------------
786
789
int c;
787
- auto x = c << 33; // error
790
+
791
+ int s = -3;
792
+ auto y = c << s; // implementation defined value
793
+
794
+ auto x = c << 33; // error, max shift count allowed is 31
788
795
-------------
796
+ )
789
797
790
798
$(H2 $(LNAME2 add_expressions, Add Expressions))
791
799
You can’t perform that action at this time.
0 commit comments