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
This commit is contained in:
Joseph Myers 2009-04-12 23:20:02 +01:00 committed by Joseph Myers
parent 849d624b4a
commit 18f41a1b45
4 changed files with 1275 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2009-04-12 Joseph Myers <joseph@codesourcery.com>
PR preprocessor/31869
* gcc.dg/cpp/strify5.c: New test.
2009-04-12 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/enum1.adb: New test.

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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;
}