Date: Thu, 7 Nov 2024 09:46:58 +0100
On 24/10/2024 09.57, Corentin via SG16 wrote:
> I think we should add words to [character.seq.general].
>
> The execution character set <https://eel.is/c++draft/library#def:character_set,execution>and the execution wide-character set <https://eel.is/c++draft/library#def:wide-character_set,execution>are supersets of the basic literal character set ([lex.charset] <https://eel.is/c++draft/lex.charset>). <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-1>The encodings of the execution character sets (termed execution encoding and wide execution encoding respectively)and the sets of additional elements (if any) are locale-specific. <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-2>Each element of the execution wide-character set is encoded as a single code unit representable by a value of type wchar_t. <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-3>
>
>
> [Note 1 <https://eel.is/c++draft/library#character.seq.general-note-1>: The encodings of the execution character sets can be unrelated to any literal encoding. <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-4>— end note]
>
>
> [Note 1: If any element of the literal character set does not have the same (or any) representation in the execution encoding as it does in the literal encoding, passing a sequence of characters encoded in the literal encoding to a standard library function expecting an argument in the execution encoding can produce unexpected effects or result in undefined behavior.
>
> Similarly, library functions, which expect their arguments in the literal encoding may produce unexpected effects or result in undefined behavior when passed character sequences in the execution encoding which are not valid in the literal encoding.]
>
>
> [Note 2: sequences of characters are never assumed to be in the execution or wide execution encodings during constant evaluation]
This is all non-normative, except introducing two defined terms, right?
Sounds editorial-with-LWG-oversight to me.
Jens
> I think we should add words to [character.seq.general].
>
> The execution character set <https://eel.is/c++draft/library#def:character_set,execution>and the execution wide-character set <https://eel.is/c++draft/library#def:wide-character_set,execution>are supersets of the basic literal character set ([lex.charset] <https://eel.is/c++draft/lex.charset>). <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-1>The encodings of the execution character sets (termed execution encoding and wide execution encoding respectively)and the sets of additional elements (if any) are locale-specific. <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-2>Each element of the execution wide-character set is encoded as a single code unit representable by a value of type wchar_t. <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-3>
>
>
> [Note 1 <https://eel.is/c++draft/library#character.seq.general-note-1>: The encodings of the execution character sets can be unrelated to any literal encoding. <https://eel.is/c++draft/library#character.seq.general-1.2.sentence-4>— end note]
>
>
> [Note 1: If any element of the literal character set does not have the same (or any) representation in the execution encoding as it does in the literal encoding, passing a sequence of characters encoded in the literal encoding to a standard library function expecting an argument in the execution encoding can produce unexpected effects or result in undefined behavior.
>
> Similarly, library functions, which expect their arguments in the literal encoding may produce unexpected effects or result in undefined behavior when passed character sequences in the execution encoding which are not valid in the literal encoding.]
>
>
> [Note 2: sequences of characters are never assumed to be in the execution or wide execution encodings during constant evaluation]
This is all non-normative, except introducing two defined terms, right?
Sounds editorial-with-LWG-oversight to me.
Jens
Received on 2024-11-07 08:47:01