C++ Logo

sg16

Advanced search

Re: [SG16] Multiple combining characters and P1949R3: C++ Identifier Syntax using Unicode Standard Annex 31

From: Jens Maurer <Jens.Maurer_at_[hidden]>
Date: Wed, 6 May 2020 10:09:01 +0200
On 06/05/2020 09.09, Corentin Jabot via SG16 wrote:
> More generally, concatenating 2 NFC sequences is not guaranteed to result in an NFC sequence.[1]
> Maybe NFC verification should be done on C++ tokens, not preprocessor token (because then we would have to check twice) ?
> But I question whether spending so much time on these contrived examples is a valuable use of anyone's time.
>
> As such, making
> #define accent(x)x##\uxxxx
>
> ill-formed is a course of action that I think should be entertained

For *any* value of xxxx, including valid XID_Start characters?

That seems non-desirable: If xxxx is in XID_Start, then \uxxxx is a valid
single-character identifier, so the concatenation operation is totally fine.

> (Afaict, concatenating 2 valid identifiers results in a valid identifier in all cases)

And \uxxxx might be a valid identifier.

Jens

Received on 2020-05-06 03:12:06