1 /* PR c/77423 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wlogical-not-parentheses" } */
4
5 #ifndef __cplusplus
6 # define bool _Bool
7 #endif
8
9 int
f(int a,bool b,bool c)10 f (int a, bool b, bool c)
11 {
12 int r = 0;
13
14 r += !a == (b | c);
15 r += !a == (b ^ c);
16 r += !a == (b & c);
17 r += !a == ~b;
18 r += !a == ~(int) b;
19 r += !a == ((b & c) | c);
20 r += !a == ((b & c) | (b ^ c));
21 r += !a == (int) (b ^ c);
22 r += !a == (int) ~b;
23 r += !a == ~~b;
24 r += !a == ~(b | c);
25 r += !a == ~(b | (a == 1));
26 r += !a == ~(a == 1);
27
28 r += !a == ((b & c) | (b ^ a)); /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
29
30 return r;
31 }
32