You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 "".
The text was updated successfully, but these errors were encountered:
It seems P2361 still didn't interpret the implicitly added \0. Reference the quote in P2361
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'.
Presumably, the constituent of user-defined-string-literal remains no change in P2361. Also, the constituent of an unevaluated-string is still string-literal. The core issue is that we didn't specify that \0 will add to the end of a string-literal in the current draft as well as in P2361.
[over.literal] p1
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
Also, [lex.string] p9 says
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:
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 text was updated successfully, but these errors were encountered: