From cc64925195396bb5f43bb5ee83f6a0398f8e49f9 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 12 Apr 2009 22:20:02 +0000 Subject: 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: https://gcc.gnu.org/svn/gcc/trunk@145989 138bc75d-0d04-0410-961f-82ee72b054a4 --- libcpp/ChangeLog | 7 +++++++ libcpp/macro.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 1a6dc55e0df..d1383af1780 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,10 @@ +2009-04-12 Joseph Myers + + 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 * Makefile.in: Change copyright header to refer to version 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; } -- cgit v1.2.3