summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-09 09:56:09 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-09 09:56:09 +0000
commitbc5dbce5adf9b3cb2c52c955cac804a1d591a985 (patch)
tree633e7b4d27241e94e09a9d75011a7ca0f24d6eca
parent62eecb5de36abcdadd2bae42d92ff30b9c678f09 (diff)
downloadppe42-gcc-bc5dbce5adf9b3cb2c52c955cac804a1d591a985.tar.gz
ppe42-gcc-bc5dbce5adf9b3cb2c52c955cac804a1d591a985.zip
* cppmacro.c (paste_tokens): Only allow / to paste with =.
testsuite: * gcc.dg/cpp/paste13.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57978 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cppmacro.c3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/paste13.c9
4 files changed, 18 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 87408b9d28a..6653ea4a41d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2002-10-09 Neil Booth <neil@daikokuya.co.uk>
+
+ * cppmacro.c (paste_tokens): Only allow / to paste with =.
+
2002-10-09 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.md (movdf splitter): Use gen_int_mode on
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 113b20dac24..fe78993bc4d 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -442,8 +442,7 @@ paste_tokens (pfile, plhs, rhs)
It is simpler to insert a space here, rather than modifying the
lexer to ignore comments in some circumstances. Simply returning
false doesn't work, since we want to clear the PASTE_LEFT flag. */
- if (lhs->type == CPP_DIV
- && (rhs->type == CPP_MULT || rhs->type == CPP_DIV))
+ if (lhs->type == CPP_DIV && rhs->type != CPP_EQ)
*end++ = ' ';
end = cpp_spell_token (pfile, rhs, end);
*end = '\0';
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9b3a86e86d5..f51687f7a50 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-10-09 Neil Booth <neil@daikokuya.co.uk>
+
+ * gcc.dg/cpp/paste13.c: New test.
+
2002-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.c-torture/execute/20020720-1.x: Take out sparc XFAILs. For
diff --git a/gcc/testsuite/gcc.dg/cpp/paste13.c b/gcc/testsuite/gcc.dg/cpp/paste13.c
new file mode 100644
index 00000000000..e59c2099656
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/paste13.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* This used to be recognized as a comment when lexing after pasting
+ spellings. Neil Booth, 9 Oct 2002. */
+
+#define a /##/=
+a /* { dg-warning "valid preprocessing tok" } */
OpenPOWER on IntegriCloud