public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111072] New: Splicing at the end fails
@ 2023-08-19  4:16 verodeving at gmail dot com
  2023-08-19  4:40 ` [Bug preprocessor/111072] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: verodeving at gmail dot com @ 2023-08-19  4:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111072
           Summary: Splicing at the end fails
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: verodeving at gmail dot com
  Target Milestone: ---

The following code fails under GCC(trunk) and the compiler options -Wall
-Werror -Wextra -pedantic-errors -Wpedantic -O3 -std=c++23(untested under other
compiler options or other GCC versions):

int \
 a;

An example of the failure can be seen at https://godbolt.org/z/WhKK7rYne

This behaviour is incorrect because https://eel.is/c++draft/lex.phases#1.2
mentions the following:

- A source file that is not empty and that does not end in a new-line
character, or that ends in a splice, shall be processed as if an additional
new-line character were appended to the file.

Therefore, the backslash at the end of the file shouldn't error because it
should behave as a new line was appended at the end of the file, according to
the mentioned standard paragraph.

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

end of thread, other threads:[~2023-08-19  4:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-19  4:16 [Bug c++/111072] New: Splicing at the end fails verodeving at gmail dot com
2023-08-19  4:40 ` [Bug preprocessor/111072] " pinskia 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).