2 /* { dg-do compile } */
3 /* { dg-options "-O -Wshift-negative-value" } */
8 C
= -1 << 1, /* { dg-warning "10:left shift of negative value" } */
9 /* { dg-error "not an integer constant" "no constant" { target { c++11 && c++17_down } } .-1 } */
10 /* { dg-error "left operand of shift expression" "shift" { target { c++11 && c++17_down } } .-2 } */
19 /* Warn for LSHIFT_EXPR. */
26 r
+= m
<< x
; /* { dg-warning "10:left shift of negative value" } */
29 r
+= -1 << x
; /* { dg-warning "11:left shift of negative value" } */
37 /* Shouldn't warn for RSHIFT_EXPR. */