Skip to content
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

[dcl.init.string] p1 Successive characters initializing array elements make nosense after P2314 #5103

Open
xmh0511 opened this issue Nov 12, 2021 · 2 comments · May be fixed by #5118
Open
Assignees

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Nov 12, 2021

Successive characters of the value of the string-literal initialize the elements of the array.

Since P2314 introduces a clear concept about "code unit", which is an integer value of a character type that is the type of the element of the character arrays. So, this outdated wording should be improved

Successive code unit values of the string-literal initialize the elements of the array.

@jensmaurer
Copy link
Member

The problem is that [lex.string] only creates a sequence of code unit values if we initialize a string literal object, but that doesn't appear in [dcl.init.string].

See the pull request.

@xmh0511
Copy link
Contributor Author

xmh0511 commented Nov 21, 2021

@jensmaurer I think the following modification may be clearer.

Each element of the array is copy-initialized from the corresponding code unit value in the sequence of code unit values represented by the string-literal.

This can stress that every element of the array is a container that saves the code unit value. [lex.charset] p5 implies this point but it is not exposed in the initialization of the character array.

A code unit is an integer value of character type ([basic.fundamental]).

The character type is exactly the type of the element of the array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants