This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Paste avoidance final tweak


I forgot to avoid a paste after a builtin (unlikely, I know - in fact
a failing case is quite hard to think of).  This is a fix and test
case update.

Neil.

	* cppmacro (cpp_get_token): Avoid pasting after a builtin.
	* gcc.dg/cpp/avoidpaste1.c: Update.

Index: cppmacro.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppmacro.c,v
retrieving revision 1.43
diff -u -p -r1.43 cppmacro.c
--- cppmacro.c	2001/02/04 08:29:46	1.43
+++ cppmacro.c	2001/02/05 20:52:24
@@ -965,6 +965,7 @@ cpp_get_token (pfile, token)
 	  if (node->flags & NODE_BUILTIN)
 	    {
 	      builtin_macro (pfile, token);
+	      pfile->buffer->saved_flags = AVOID_LPASTE;
 	      break;
 	    }
 
Index: testsuite/gcc.dg/cpp/avoidpaste1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c,v
retrieving revision 1.3
diff -u -p -r1.3 avoidpaste1.c
--- avoidpaste1.c	2001/01/31 07:50:11	1.3
+++ avoidpaste1.c	2001/02/05 20:52:24
@@ -15,19 +15,19 @@
 /* This should preprocess as
 
 :: : : : : :^: 1.0e- 1
-: : : .. . 0
+: : : .. . 0 0 .
 
 It relies on the fact that even when preprocessing C we bother to separate
 the colons of C++'s :: operator.  If we confine this behaviour to C++
 in future, this test needs to change.  */
 
 :: :g: :f(): :f(^): tricky
-:f(:): .. .__INCLUDE_LEVEL__	/* Check builtins, too.  */
+:f(:): .. .__INCLUDE_LEVEL__ _INCLUDE_LEVEL__. /* Check builtins, too.  */
 
 /*
    { dg-final { if ![file exists avoidpaste1.i] { return }                } }
    { dg-final { if { [grep avoidpaste1.i ":: : : : : :\\^: 1.0e- 1"] != "" } \{   } }
-   { dg-final { if { [grep avoidpaste1.i ": : : \\\.\\\. \\\. 0"] != "" } \{  } }
+   { dg-final { if { [grep avoidpaste1.i ": : : \\\.\\\. \\\. 0 0 \\\."] != "" } \{  } }
    { dg-final { return \} \}                                              } }
    { dg-final { fail "avoidpaste1.c: paste avoidance"                     } }
 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]