2 // { dg-options "-Wparentheses" }
4 // C++ version of gcc.dg/Wparentheses-7.c
9 bar (int a, int b, int c)
11 foo (a & b ^ c); // { dg-warning "parentheses" "correct warning" }
14 foo (1 & 2 ^ c); // { dg-warning "parentheses" "correct warning" }
17 foo (1 & 2 ^ 3); // { dg-warning "parentheses" "correct warning" }
20 foo (a ^ b & c); // { dg-warning "parentheses" "correct warning" }
23 foo (1 ^ 2 & c); // { dg-warning "parentheses" "correct warning" }
26 foo (1 ^ 2 & 3); // { dg-warning "parentheses" "correct warning" }
29 foo (a + b ^ c); // { dg-warning "parentheses" "correct warning" }
32 foo (1 + 2 ^ c); // { dg-warning "parentheses" "correct warning" }
35 foo (1 + 2 ^ 3); // { dg-warning "parentheses" "correct warning" }
38 foo (a ^ b + c); // { dg-warning "parentheses" "correct warning" }
41 foo (1 ^ 2 + c); // { dg-warning "parentheses" "correct warning" }
44 foo (1 ^ 2 + 3); // { dg-warning "parentheses" "correct warning" }
47 foo (a - b ^ c); // { dg-warning "parentheses" "correct warning" }
50 foo (1 - 2 ^ c); // { dg-warning "parentheses" "correct warning" }
53 foo (1 - 2 ^ 3); // { dg-warning "parentheses" "correct warning" }
56 foo (a ^ b - c); // { dg-warning "parentheses" "correct warning" }
59 foo (1 ^ 2 - c); // { dg-warning "parentheses" "correct warning" }
62 foo (1 ^ 2 - 3); // { dg-warning "parentheses" "correct warning" }
65 foo (a >= b ^ c); // { dg-warning "parentheses" "correct warning" }
68 foo (1 >= 2 ^ c); // { dg-warning "parentheses" "correct warning" }
71 foo (1 >= 2 ^ 3); // { dg-warning "parentheses" "correct warning" }
74 foo (a ^ b >= c); // { dg-warning "parentheses" "correct warning" }
77 foo (1 ^ 2 >= c); // { dg-warning "parentheses" "correct warning" }
80 foo (1 ^ 2 >= 3); // { dg-warning "parentheses" "correct warning" }
83 foo (a == b ^ c); // { dg-warning "parentheses" "correct warning" }
86 foo (1 == 2 ^ c); // { dg-warning "parentheses" "correct warning" }
89 foo (1 == 2 ^ 3); // { dg-warning "parentheses" "correct warning" }
92 foo (a ^ b == c); // { dg-warning "parentheses" "correct warning" }
95 foo (1 ^ 2 == c); // { dg-warning "parentheses" "correct warning" }
98 foo (1 ^ 2 == 3); // { dg-warning "parentheses" "correct warning" }
101 foo (a < b ^ c); // { dg-warning "parentheses" "correct warning" }
104 foo (1 < 2 ^ c); // { dg-warning "parentheses" "correct warning" }
107 foo (1 < 2 ^ 3); // { dg-warning "parentheses" "correct warning" }
110 foo (a ^ b < c); // { dg-warning "parentheses" "correct warning" }
113 foo (1 ^ 2 < c); // { dg-warning "parentheses" "correct warning" }
116 foo (1 ^ 2 < 3); // { dg-warning "parentheses" "correct warning" }