summaryrefslogtreecommitdiff
path: root/libcpp/macro.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-12 22:20:02 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-12 22:20:02 +0000
commite21164ef524e2f55c00addd7260f9318cf604806 (patch)
tree6ae1a7f8a15b2c180c7df052633170511e1bf746 /libcpp/macro.c
parentf2143b567f73be2638c7a1e5abd0e8e5aeacb016 (diff)
downloadgcc-e21164ef524e2f55c00addd7260f9318cf604806.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145989 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/macro.c')
-rw-r--r--libcpp/macro.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcpp/macro.c b/libcpp/macro.c
index b6a766696a8..75c1c55e022 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;
}