Title
Cannot depend on an already-deleted splice
Status
drwp
Section
5.2 [lex.phases]
Submitter
Jim X

Created on 2021-09-14.00:00:00 last changed 7 months ago

Messages

Date: 2023-07-14.22:00:05

CWG 2023-07-14

CWG noted that a lone backslash at the end of a file remains (in the status quo and with the proposed change) and turns into an ill-formed preprocessing-token. The wording as amended seems sufficiently clear to consider issue 1698 resolved.

Date: 2023-07-14.22:00:05

Proposed resolution (approved by CWG 2023-07-14):

Change in 5.2 [lex.phases] paragraph 2 as follows:

... Each sequence of a backslash character (\) immediately followed by zero or more whitespace characters other than new-line followed by a new-line character is deleted, splicing physical source lines to form logical source lines. ... A source file that is not empty and that (after splicing) 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.
Date: 2023-11-15.00:00:00

[Accepted as a DR at the November, 2023 meeting.]

(From editorial issue 4903.)

Subclause 5.2 [lex.phases] paragraph 2 specifies:

... Each sequence of a backslash character (\) immediately followed by zero or more whitespace characters other than new-line followed by a new-line character is deleted, splicing physical source lines to form logical source lines. ... 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.

This is confusing, because the first sentence deletes all splices, and then the last sentence checks for a splice that has already been deleted.

History
Date User Action Args
2024-04-05 21:43:46adminsetstatus: dr -> drwp
2023-12-19 10:15:28adminsetstatus: ready -> dr
2023-07-14 22:00:05adminsetmessages: + msg7367
2023-07-14 22:00:05adminsetmessages: + msg7366
2023-07-14 22:00:05adminsetstatus: open -> ready
2021-09-14 00:00:00admincreate