aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-04-12 23:20:02 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2009-04-12 23:20:02 +0100
commit18f41a1b45de2a83725299a8e6544c1f226dd4da (patch)
tree6ae1a7f8a15b2c180c7df052633170511e1bf746 /libcpp
parent849d624b4a81f4dc9546e29571c970994dc935ed (diff)
downloadgcc-18f41a1b45de2a83725299a8e6544c1f226dd4da.zip
gcc-18f41a1b45de2a83725299a8e6544c1f226dd4da.tar.gz
gcc-18f41a1b45de2a83725299a8e6544c1f226dd4da.tar.bz2
re PR preprocessor/31869 (stringifying empty macros)
libcpp: PR preprocessor/31869 * macro.c (stringify_arg): Handle NULL source token in padding token where previous padding token did not have source token with preceding whitespace. gcc/testsuite: * gcc.dg/cpp/strify5.c: New test. From-SVN: r145989
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog7
-rw-r--r--libcpp/macro.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 1a6dc55..d1383af 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-12 Joseph Myers <joseph@codesourcery.com>
+
+ PR preprocessor/31869
+ * macro.c (stringify_arg): Handle NULL source token in padding
+ token where previous padding token did not have source token with
+ preceding whitespace.
+
2009-04-09 Jakub Jelinek <jakub@redhat.com>
* Makefile.in: Change copyright header to refer to version
diff --git a/libcpp/macro.c b/libcpp/macro.c
index b6a7666..75c1c55 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -369,7 +369,9 @@ stringify_arg (cpp_reader *pfile, macro_arg *arg)
if (token->type == CPP_PADDING)
{
- if (source == NULL)
+ if (source == NULL
+ || (!(source->flags & PREV_WHITE)
+ && token->val.source == NULL))
source = token->val.source;
continue;
}