This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 113d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-05


912. Character literals and universal-character-names

Section: 5.13.3  [lex.ccon]     Status: CD3     Submitter: Alisdair Meredith     Date: 7 June, 2009

[Moved to DR at the October, 2012 meeting.]

According to 5.13.3 [lex.ccon] paragraph 1,

A character literal that does not begin with u, U, or L is an ordinary character literal, also referred to as a narrow-character literal. An ordinary character literal that contains a single c-char has type char, with value equal to the numerical value of the encoding of the c-char in the execution character set.

However, the definition of c-char includes as one possibility a universal-character-name. The value of a universal-character-name cannot, in general, be represented as a char, so this specification is impossible to satisfy.

(See also issue 411 for related questions.)

Additional note (February, 2012):

See the discussion in issue 1422 for a possible interpretation of the existing text.

Proposed resolution (February, 2012):

Change 5.13.3 [lex.ccon] paragraph 1 as follows:

...A character literal that does not begin with u, U, or L is an ordinary character literal, also referred to as a narrow-character literal. An ordinary character literal that contains a single c-char representable in the execution character set has type char, with value equal to the numerical value of the encoding of the c-char in the execution character set. An ordinary character literal that contains more than one c-char is a multicharacter literal. A multicharacter literal, or an ordinary character literal containing a single c-char not representable in the execution character set, is conditionally-supported, has type int, and has an implementation-defined value.

This resolution also resolves issue 1024.