diff options
Diffstat (limited to 'test/Sema/parentheses.c')
| -rw-r--r-- | test/Sema/parentheses.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/Sema/parentheses.c b/test/Sema/parentheses.c index 69c91cb15f47..e53f0eb99bc1 100644 --- a/test/Sema/parentheses.c +++ b/test/Sema/parentheses.c @@ -5,17 +5,21 @@ void if_assign(void) { int i; if (i = 4) {} // expected-warning {{assignment as a condition}} \ - // expected-note{{use '==' to turn this assignment into an equality comparison}} + // expected-note{{use '==' to turn this assignment into an equality comparison}} \ + // expected-note{{place parentheses around the assignment to silence this warning}} if ((i = 4)) {} } void bitwise_rel(unsigned i) { (void)(i & 0x2 == 0); // expected-warning {{& has lower precedence than ==}} \ - // expected-note{{place parentheses around the & expression to evaluate it first}} + // expected-note{{place parentheses around the & expression to evaluate it first}} \ + // expected-note{{place parentheses around the == expression to silence this warning}} (void)(0 == i & 0x2); // expected-warning {{& has lower precedence than ==}} \ - // expected-note{{place parentheses around the & expression to evaluate it first}} + // expected-note{{place parentheses around the & expression to evaluate it first}} \ + // expected-note{{place parentheses around the == expression to silence this warning}} (void)(i & 0xff < 30); // expected-warning {{& has lower precedence than <}} \ - // expected-note{{place parentheses around the & expression to evaluate it first}} + // expected-note{{place parentheses around the & expression to evaluate it first}} \ + // expected-note{{place parentheses around the < expression to silence this warning}} (void)((i & 0x2) == 0); (void)(i & (0x2 == 0)); // Eager logical op |
