Skip to content

[lex.string,dcl.init.string] Use 'code unit' for initialization from a string-literal #5118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5367,12 +5367,11 @@
UTF-32 string literal, or
wide string literal,
respectively, or by an appropriately-typed \grammarterm{string-literal} enclosed in
braces\iref{lex.string}.
braces.
\indextext{initialization!character array}%
Successive
characters of the
value of the \grammarterm{string-literal}
initialize the elements of the array.
The elements of the array are initialized
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jensmaurer Please look at this comment. values of the sequence of code unit values sounds a bit vague; what value is that?

with successive values of the sequence of code unit values
represented by the \grammarterm{string-literal}\iref{lex.string}.
\begin{example}
\begin{codeblock}
char msg[] = "Syntax error on line %s\n";
Expand Down
6 changes: 4 additions & 2 deletions source/lex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1881,9 +1881,11 @@
\indextext{\idxcode{0}|seealso{zero, null}}%
\indextext{\idxcode{0}!string terminator}%
\indextext{\idxcode{0}!null character|see {character, null}}%
String literal objects are initialized with
A string literal object is initialized with
the sequence of code unit values
corresponding to the \grammarterm{string-literal}'s sequence of
represented by the \grammarterm{string-literal}.
A \grammarterm{string-literal} represents
a sequence of code unit values corresponding to the sequence of
\grammarterm{s-char}s (originally from non-raw string literals) and
\grammarterm{r-char}s (originally from raw string literals),
plus a terminating \unicode{0000}{null} character,
Expand Down