2 /* { dg-do compile } */
3 /* { dg-options "-O -Wshift-negative-value" } */
4 /* { dg-additional-options "-std=c++11" { target c++ } } */
9 C
= -1 << 1, /* { dg-warning "left shift of negative value" } */
18 /* Warn for LSHIFT_EXPR. */
25 r
+= m
<< x
; /* { dg-warning "left shift of negative value" } */
28 r
+= -1 << x
; /* { dg-warning "left shift of negative value" } */
36 /* Shouldn't warn for RSHIFT_EXPR. */
51 /* { dg-error "not an integer constant" "no constant" { target c++ } 9 } */
52 /* { dg-error "left operand of shift expression" "shift" { target c++ } 9 } */