directives.c (parse_include): Pass true to check_eol.

libcpp:
	* directives.c (parse_include): Pass true to check_eol.

gcc/testsuite:
	* gcc.dg/cpp/include5.c: New test.

From-SVN: r146327
This commit is contained in:
Joseph Myers 2009-04-18 21:25:07 +01:00 committed by Joseph Myers
parent 149ccdd45d
commit 61cc82231b
4 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2009-04-18 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/cpp/include5.c: New test.
2009-04-18 Joseph Myers <joseph@codesourcery.com>
PR c/35210

View File

@ -0,0 +1,9 @@
/* Test #include directives with macros expanding to empty. */
#define EMPTY_OBJ
#define EMPTY_FUNC()
#include <stddef.h> EMPTY_OBJ
#include <stddef.h> EMPTY_FUNC()
#include "stddef.h" EMPTY_OBJ
#include "stddef.h" EMPTY_FUNC()

View File

@ -1,3 +1,7 @@
2009-04-18 Joseph Myers <joseph@codesourcery.com>
* directives.c (parse_include): Pass true to check_eol.
2009-04-18 Joseph Myers <joseph@codesourcery.com>
PR preprocessor/39646

View File

@ -724,7 +724,7 @@ parse_include (cpp_reader *pfile, int *pangle_brackets,
/* This pragma allows extra tokens after the file name. */
}
else if (buf == NULL || CPP_OPTION (pfile, discard_comments))
check_eol (pfile, false);
check_eol (pfile, true);
else
{
/* If we are not discarding comments, then gather them while