2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / tr-warn2.c
blob85b624761eb12ee52a6a859edcdddf8470708448
1 /* K+R rejects use of function-like macros in non-function context.
2 ANSI C explicitly permits this (the macro is not expanded).
4 We should not warn about this during pre-expansion of arguments,
5 since traditional preprocessors don't do pre-expansion, and we get
6 the warning anyway during the re-scan pass if and only if it is
7 appropriate. */
9 /* { dg-do preprocess } */
10 /* { dg-options -Wtraditional } */
12 #define f(x) x
13 #define g(x) x / 2
14 #define h(a, b) a(b)
15 f(g) (3) /* { dg-bogus "must be used with arguments" } */
16 f 2 /* { dg-warning "must be used with arguments" } */
17 f(g) 3 /* { dg-warning "must be used with arguments" } */
18 h(f, 3) /* { dg-bogus "must be used with arguments" } */