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

[lex.string]: Encoding described only for expression evaluation #5090

Open
hubert-reinterpretcast opened this issue Nov 6, 2021 · 1 comment · May be fixed by #5095
Open

[lex.string]: Encoding described only for expression evaluation #5090

hubert-reinterpretcast opened this issue Nov 6, 2021 · 1 comment · May be fixed by #5095
Assignees

Comments

@hubert-reinterpretcast
Copy link
Contributor

In [lex.string], the length of the array type of a string literal determined from the number of encoded code units "as described below"; however, the further description only describes encoding for string literal objects, and string literal objects are only mentioned in relation to evaluating a string-literal.

A string may appear within unevaluated operands in such a way that its type needs to be known, for example:

char s[sizeof("Hello, world!")];

As per [expr.context], "[an] unevaluated operand is not evaluated".

Perhaps, "where n is the number of encoded code units as described below in the result of an evaluation of the string-literal were it to be evaluated" would work?

@hubert-reinterpretcast
Copy link
Contributor Author

@jensmaurer, as discussed Wednesday.

@jensmaurer jensmaurer self-assigned this Nov 7, 2021
@jensmaurer jensmaurer linked a pull request Nov 7, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants