Fariborz Jahanian | 81ab3cf | 2011-04-13 20:31:26 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -pedantic -fixit -x c %s |
| 2 | // rdar://9091893 |
| 3 | |
| 4 | #define va_arg(ap, type) __builtin_va_arg(ap, type) |
| 5 | typedef __builtin_va_list va_list; |
| 6 | |
| 7 | void myFunc() { |
| 8 | va_list values; |
| 9 | |
| 10 | int value; |
| 11 | |
| 12 | while (value = va_arg(values, int)) { // expected-warning {{using the result of an assignment as a condition without parentheses}} \ |
Fariborz Jahanian | 6027461 | 2011-04-13 22:18:37 +0000 | [diff] [blame] | 13 | // expected-note {{use '==' to turn this assignment into an equality comparison}} \ |
| 14 | // expected-note {{place parentheses around the assignment to silence this warning}} |
Fariborz Jahanian | 81ab3cf | 2011-04-13 20:31:26 +0000 | [diff] [blame] | 15 | } |
| 16 | } |