This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to cpphash:collect_expansion
- To: Zack Weinberg <zack at wolery dot cumb dot org>
- Subject: Patch to cpphash:collect_expansion
- From: Jason Merrill <jason at cygnus dot com>
- Date: 07 Mar 2000 00:26:23 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20000302121427.D452@wolery.cumb.org>
We were catching ## at the end of a macro, but not at the beginning.
2000-03-06 Jason Merrill <jason@casey.cygnus.com>
* cpphash.c (collect_expansion): Also catch ## at start of macro.
Index: cpphash.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpphash.c,v
retrieving revision 1.45
diff -c -p -r1.45 cpphash.c
*** cpphash.c 2000/03/04 01:42:56 1.45
--- cpphash.c 2000/03/07 08:23:02
*************** collect_expansion (pfile, arglist)
*** 346,351 ****
--- 346,353 ----
else if (last_token == PASTE)
/* ## ## - the second ## is ordinary. */
goto norm;
+ else if (last_token == START)
+ cpp_error (pfile, "`##' at start of macro definition");
/* Discard the token and any hspace before it. */
while (is_hspace (pfile->token_buffer[here-1]))