public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/101298] New: Inclusion of a file without trailing newline breaks -fdirectives-only
@ 2021-07-02 13:12 boris at kolpackov dot net
  2021-07-05  6:13 ` [Bug preprocessor/101298] [11/12 Regression] " rguenth at gcc dot gnu.org
  2021-07-19 17:10 ` [Bug c++/101298] " jakub at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: boris at kolpackov dot net @ 2021-07-02 13:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101298

            Bug ID: 101298
           Summary: Inclusion of a file without trailing newline breaks
                    -fdirectives-only
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: boris at kolpackov dot net
  Target Milestone: ---

cat <<EOF >test.cxx
#include "test.hxx"
#include <iostream>
int main () {}
EOF

echo -n "// no newline" >test.hxx

g++ -E -fdirectives-only -o test.ii test.cxx
In file included from test.cxx:1:
test.hxx:1:1: error: unterminated comment

echo -n "void f () {}" >test.hxx

g++ -E -fdirectives-only -o test.ii test.cxx

grep "void f () {}" test.ii
void f () {}# 2 "test.cxx" 2

g++ -c -fdirectives-only test.ii
In file included from test.cxx:1:
test.hxx:1:13: error: stray ‘#’ in program

This used to work fine prior to GCC 11. I believe this issue is similar but not
the same as bug #100646.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-19 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 13:12 [Bug preprocessor/101298] New: Inclusion of a file without trailing newline breaks -fdirectives-only boris at kolpackov dot net
2021-07-05  6:13 ` [Bug preprocessor/101298] [11/12 Regression] " rguenth at gcc dot gnu.org
2021-07-19 17:10 ` [Bug c++/101298] " jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).