mirror of git://gcc.gnu.org/git/gcc.git
21 lines
782 B
C
21 lines
782 B
C
/* 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-warning "logical not is only applied to the left hand side of comparison" } */
|
|
r = !b != 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
|
|
r = !b > 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
|
|
r = !b >= 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
|
|
r = !b < 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
|
|
r = !b <= 1; /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
|
|
}
|