Title
Concatenation of raw and non-raw string literals
Status
cd2
Section
5.13.5 [lex.string]
Submitter
JP

Created on 2009-03-03.00:00:00 last changed 179 months ago

Messages

Date: 2009-10-15.00:00:00

[Voted into WP at October, 2009 meeting.]

Date: 2009-09-15.00:00:00

Proposed resolution (September, 2009):

  1. In 5.13.5 [lex.string], replace the definition of string-literal with:

    • string-literal:
        encoding-prefixopt " s-char-sequenceopt "
        encoding-prefixopt R raw-string

      encoding-prefix:
        u8
        u
        U
        L
  2. Change 5.13.5 [lex.string] paragraph 5 as follows:

  3. A After translation phase 6, a string literal that does not begin with u8, u, U, or L an encoding-prefix is an ordinary string literal, and is initialized with the given characters.
  4. Change 5.13.5 [lex.string] paragraph 12 as follows:

  5. In translation phase 6 (5.2 [lex.phases]), adjacent string literals are concatenated. If both string literals have the same prefix encoding-prefix, the resulting concatenated string literal has that prefix encoding-prefix. If one string literal has no prefix encoding-prefix, it is treated as a string literal of the same prefix encoding-prefix as the other operand. If a UTF-8 string literal token is adjacent to a wide string literal token, the program is ill-formed. Any other concatenations are conditionally supported with implementation-defined behavior. [Note: This concatenation is an interpretation, not a conversion. Because the interpretation happens in translation phase 6 (after each character from each literal has been translated into a value from the appropriate character set), a string literal's initial rawness has no effect on the interpretation or well-formedness of the concatenation.end note] [Example:...

(Note: this resolution also resolves issue 834.)

Date: 2009-03-15.00:00:00

Notes from the March, 2009 meeting:

A raw string should be considered equivalent to the corresponding non-raw string in string literal concatenation.

Date: 2009-03-03.00:00:00
N2800 comment JP 5

The description of concatenation of string literals in 5.13.5 [lex.string] paragraph 11 does not mention raw strings explicitly, so it is not clear whether, and if so, how, they combine with non-raw strings.

History
Date User Action Args
2010-03-29 00:00:00adminsetstatus: dr -> cd2
2009-11-08 00:00:00adminsetmessages: + msg2419
2009-11-08 00:00:00adminsetstatus: tentatively ready -> dr
2009-09-29 00:00:00adminsetmessages: + msg2287
2009-09-29 00:00:00adminsetstatus: drafting -> tentatively ready
2009-03-23 00:00:00adminsetmessages: + msg1940
2009-03-03 00:00:00admincreate