| 1 |
// PR c++/36069 Strange "warning: suggest parentheses around |
| 2 |
// assignment used as truth value" with volatile/non volatile bools |
| 3 |
// { dg-do compile } |
| 4 |
// { dg-options "-Wparentheses" } |
| 5 |
struct foo { |
| 6 |
bool a; |
| 7 |
volatile bool b,c; |
| 8 |
foo() { a = b = c = false; } // { dg-bogus "parentheses" } |
| 9 |
// { dg-warning "deprecated" "" { target c++2a } .-1 } |
| 10 |
}; |
| 11 |
|
| 12 |
int main() { |
| 13 |
bool a; |
| 14 |
volatile bool b,c; |
| 15 |
a = b = c = false; // { dg-bogus "parentheses" } |
| 16 |
// { dg-warning "deprecated" "" { target c++2a } .-1 } |
| 17 |
foo A; |
| 18 |
} |