Title
Undefined behavior of line splice in raw string literal
Status
c++14
Section
5.2 [lex.phases]
Submitter
Canada

Created on 2013-09-24.00:00:00 last changed 81 months ago

Messages

Date: 2014-02-15.00:00:00

[Moved to DR at the February, 2014 meeting.]

Date: 2013-09-15.00:00:00

Proposed resolution (September, 2013):

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

  1. Each instance of a backslash character (\) immediately followed by a new-line character is deleted, splicing physical source lines to form logical source lines. Only the last backslash on any physical source line shall be eligible for being part of such a splice. If, as a result, Except for splices reverted in a raw string literal, if a splice results in a character sequence that matches the syntax of a universal-character-name is produced, the behavior is undefined. A source file that is not empty and that does not end in a new-line character, or that ends in a new-line character immediately preceded by a backslash character before any such splicing takes place, shall be processed as if an additional new-line character were appended to the file.

Date: 2013-09-24.00:00:00
N3690 comment CA 26

According to phase 2 of 5.2 [lex.phases] paragraph 1,

Each instance of a backslash character (\) immediately followed by a new-line character is deleted, splicing physical source lines to form logical source lines. Only the last backslash on any physical source line shall be eligible for being part of such a splice. If, as a result, a character sequence that matches the syntax of a universal-character-name is produced, the behavior is undefined.

There does not appear to be a good reason for the behavior to be undefined when the line splice occurs within a raw string literal, since the splicing will be reverted (5.4 [lex.pptoken] paragraph 3).

History
Date User Action Args
2014-11-24 00:00:00adminsetstatus: dr -> c++14
2014-03-03 00:00:00adminsetmessages: + msg4925
2014-03-03 00:00:00adminsetstatus: ready -> dr
2013-10-14 00:00:00adminsetmessages: + msg4564
2013-09-24 00:00:00admincreate