comparison gcc/testsuite/g++.dg/warn/Wparentheses-25.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
3 /* { dg-do compile } */ 3 /* { dg-do compile } */
4 /* { dg-options "-Wparentheses" } */ 4 /* { dg-options "-Wparentheses" } */
5 // C++ version of Wparentheses-11.c 5 // C++ version of Wparentheses-11.c
6 int foo (int); 6 int foo (int);
7 7
8 int 8 void
9 bar (int a, int b, int c) 9 bar (int a, int b, int c)
10 { 10 {
11 foo (!a & b); /* { dg-warning "parentheses" "correct warning" } */ 11 foo (!a & b); /* { dg-warning "parentheses" "correct warning" } */
12 foo (!a & (b < c)); 12 foo (!a & (b < c));
13 foo (!a & (b > c)); 13 foo (!a & (b > c));
154 foo (!(2 | 1)); 154 foo (!(2 | 1));
155 foo (2 | (!1)); 155 foo (2 | (!1));
156 } 156 }
157 157
158 158
159 int 159 void
160 baz (int a, int b, int c) 160 baz (int a, int b, int c)
161 { 161 {
162 foo (!a & (b << c));/* { dg-warning "parentheses" "correct warning" } */ 162 foo (!a & (b << c));/* { dg-warning "parentheses" "correct warning" } */
163 foo (!a & (b >> c));/* { dg-warning "parentheses" "correct warning" } */ 163 foo (!a & (b >> c));/* { dg-warning "parentheses" "correct warning" } */
164 foo (!a & (b + c)); /* { dg-warning "parentheses" "correct warning" } */ 164 foo (!a & (b + c)); /* { dg-warning "parentheses" "correct warning" } */