Richard Smith | eb3ce7c | 2011-12-16 22:50:01 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify |
| 2 | |
| 3 | // header1.h |
| 4 | void fail(const char *); |
| 5 | #define MUNCH(...) \ |
| 6 | ({ int result = 0; __VA_ARGS__; if (!result) { fail(#__VA_ARGS__); }; result }) |
| 7 | |
| 8 | static inline int f(int k) { |
| 9 | return MUNCH( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{returning 'void'}} |
| 10 | if (k < 3) |
| 11 | result = 24; |
| 12 | else if (k > 4) |
| 13 | result = k - 4; |
| 14 | } |
| 15 | |
| 16 | #include "macro_arg_directive.h" // expected-error {{embedding a #include directive within macro arguments is not supported}} |
| 17 | |
| 18 | int g(int k) { |
| 19 | return f(k) + f(k-1)); |
| 20 | } |