Files
cppdraft_translate/cppdraft/uaxid/def.md
2025-10-25 03:02:53 +03:00

2.4 KiB

[uaxid.def]

Annex E (informative) Conformance with UAX #31 [uaxid]

E.2 R1 Default identifiers [uaxid.def]

E.2.1 General [uaxid.def.general]

1

#

UAX #31 specifies a default syntax for identifiers based on properties from the Unicode Character Database, UAX #44.

The general syntax is

<Identifier> := <Start> <Continue>* (<Medial> <Continue>+)*

where has the XID_Start property, has the XID_Continue property, and is a list of characters permitted between continue characters.

For C++ we add the character U+005f low line, or _, to the set of permitted characters, the set is empty, and the characters are unmodified.

In the grammar used in UAX #31, this is

<Identifier> := <Start> <Continue>*
<Start> := XID_Start + U+005f
<Continue> := <Start> + XID_Continue

2

#

This is described in the C++ grammar in [lex.name], where identifier is formed fromidentifier-start oridentifier followed by identifier-continue.

E.2.2 R1b Stable identifiers [uaxid.def.stable]

1

#

An implementation of UAX #31 may choose to guarantee that identifiers are stable across versions of the Unicode Standard.

Once a string qualifies as an identifier it does so in all future versions.

2

#

C++ does not make this guarantee, except to the extent that UAX #31 guarantees the stability of the XID_Start and XID_Continue properties.