gcc/testsuite/c-c++-common/Wparentheses-2.c
raw| 1 | // PR c++/95344 - bogus -Wparentheses warning. |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-Wparentheses" } |
| 4 | |
| 5 | #ifndef __cplusplus |
| 6 | # define bool _Bool |
| 7 | # define true 1 |
| 8 | # define false 0 |
| 9 | #endif |
| 10 | |
| 11 | void |
| 12 | f (int i) |
| 13 | { |
| 14 | bool b = false; |
| 15 | if (i == 99 ? (b = true) : false) // { dg-bogus "suggest parentheses" } |
| 16 | { |
| 17 | } |
| 18 | } |