1 /* { dg-do compile } */
2 /* { dg-options "-Wlogical-not-parentheses" } */
4 /* Test that we don't warn if rhs is 0 and comparison is == or !=. */
17 r
= !a
== 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
18 r
= !a
!= 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
24 r
= !a
> 0; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
25 r
= !a
>= 0; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
26 r
= !a
< 0; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
27 r
= !a
<= 0; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
28 r
= !a
> 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
29 r
= !a
>= 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
30 r
= !a
< 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
31 r
= !a
<= 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */