2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / macro10.c
blob20d4911e64878ea42d4049915df93fb540380fd5
1 /* Copyright (C) 2001 Free Software Foundation, Inc. */
3 /* { dg-do preprocess } */
5 /* Source: Neil Booth, 23 Sep 2001.
7 A tricky, pathological corner case we used to get wrong. Expansion
8 should go as follows. The asterisk indicates the token has "blue
9 paint" can no longer be macro expanded. We used to lose that
10 information when parsing arguments and dropping to the lexer to get
11 the ')'.
13 foo )
14 bar foo* )
15 func (foo* )
16 foo*
18 If we try and expand the final foo, we get an "unterminated
19 argument list invoking macro <func>" error. If we do the right
20 thing and leave it as is, no diagnostics are emitted. */
22 #define func(x) x
23 #define bar func(
24 #define foo bar foo
25 foo )