preprocessor: Fix ICE with EOF in macro args [pr95182]
authorNathan Sidwell <nathan@acm.org>
Tue, 19 May 2020 13:11:22 +0000 (06:11 -0700)
committerNathan Sidwell <nathan@acm.org>
Tue, 19 May 2020 13:19:31 +0000 (06:19 -0700)
commita641d6d3e631e523e8cf0cfc8b8e324da118dff2
treee758c982763a130f5ec3e92f0decd43d84affaf4
parent92ea8e1bccc6a703407570471f6323bfa554af99
preprocessor: Fix ICE with EOF in macro args [pr95182]

This was another latent case of us losing an EOF token, but succeeding
anyway.  Since my patch to make us pay more attention to EOFs it came
to light.  We also need to keep the EOF if we fall off the end of the
main file.  Forced includes look like regular nested includes at this
point.

PR preprocessor/95182
libcpp/
* macro.c (collect_args): Preserve EOFif we fell out of the main
file.
(cpp_get_token_1): Reformat a couple of short lines.
gcc/testsuite/c-c++-common/cpp/eof-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cpp/eof-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cpp/eof-2.h [new file with mode: 0644]
gcc/testsuite/c-c++-common/cpp/eof-3.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/macro.c