c++: directives-only preprocessing and include translation [PR 99050]
authorNathan Sidwell <nathan@acm.org>
Tue, 16 Feb 2021 20:23:12 +0000 (12:23 -0800)
committerNathan Sidwell <nathan@acm.org>
Tue, 16 Feb 2021 20:26:51 +0000 (12:26 -0800)
commitb37695c9bf101a3a30a231cfeb6da7a6c17657d6
tree20733ade4d65e611ce39800abc5ac2403c440bfd
parent30a4d95bf76b0a0fdb66ac0211589a4434c83af3
c++: directives-only preprocessing and include translation [PR 99050]

We make sure files end in \n by placing one at the limit of the buffer
(just past the end of what is read).  We need to do the same for
buffers generated via include-translation.  Fortunately they have
space.

libcpp/
* files.c (_cpp_stack_file): Make buffers end in unread \n.
gcc/testsuite/
* g++.dg/modules/pr99050_a.H: New.
* g++.dg/modules/pr99050_b.C: New.
gcc/testsuite/g++.dg/modules/pr99050_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99050_b.C [new file with mode: 0644]
libcpp/files.c