blob: 5d25a0ac6d5a954713e1a824dc6ab4b9a25c58cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
/* PR c++/62199 */
/* { dg-do compile } */
/* { dg-options "-Wlogical-not-parentheses" } */
#ifndef __cplusplus
# define bool _Bool
#endif
bool r;
void
foo (bool b)
{
r = !b == 1; /* { dg-bogus "logical not is only applied to the left hand side of comparison" } */
r = !b != 1; /* { dg-bogus "logical not is only applied to the left hand side of comparison" } */
r = !b > 1; /* { dg-bogus "logical not is only applied to the left hand side of comparison" } */
r = !b >= 1; /* { dg-bogus "logical not is only applied to the left hand side of comparison" } */
r = !b < 1; /* { dg-bogus "logical not is only applied to the left hand side of comparison" } */
r = !b <= 1; /* { dg-bogus "logical not is only applied to the left hand side of comparison" } */
}
|