-
Notifications
You must be signed in to change notification settings - Fork 784
Description
[over.literal] p1
The string-literal or user-defined-string-literal in a literal-operator-id shall have no encoding-prefix and shall contain no characters other than the implicit terminating '\0'.
we didn't say a character \0
will implicitly add to the end of a string-literal in the current draft. Instead, we say
[lex.string] p10
String literal objects are initialized with the sequence of code unit values corresponding to the string-literal's sequence of s-chars (originally from non-raw string literals) and r-chars (originally from raw string literals), plus a terminating U+0000 NULL character, in order as follows
Also, [lex.string] p9 says
Evaluating a string-literal results in a string literal object with static storage duration ([basic.stc]).
I think "string-literal" in literal-operator-id is not an expression, there is no evaluation in this context, I believe. [lex.string] p10 is different with [lex.string] p12 in the c++20 standard:
After any necessary concatenation, in translation phase 7 ([lex.phases]), '\0' is appended to every string-literal so that programs that scan a string can find its end.
The above provision is arbitrarily applied to any "string-literal". So, [over.literal] p1 may be correct on this way in the current draft
The string-literal or the string-literal of the user-defined-string-literal in a literal-operator-id shall have no encoding-prefix and the string-literal shall be "".