Title
Unspecified interpretation of numeric-escape-sequence
Status
cd6
Section
5.13.3 [lex.ccon]
Submitter
Richard Smith

Created on 2022-02-25.00:00:00 last changed 3 months ago

Messages

Date: 2022-02-18.07:47:23

Proposed resolution (approved by CWG 2022-03-11):

  1. Change in 5.13.3 [lex.ccon] bullet 3.2 as follows:
    • A character-literal with a c-char-sequence consisting of a single numeric-escape-sequence that specifies an integer value v has a value as follows:
      • Let v be the integer value represented by the octal number comprising the sequence of octal-digits in an octal-escape-sequence or by the hexadecimal number comprising the sequence of hexadecimal-digits in a hexadecimal-escape-sequence.
      • If v does not exceed the range of representable values of the character-literal's type, then the value is v.
      • ...
  2. Change in 5.13.5 [lex.string] bullet 10.2 as follows:
    • Each numeric-escape-sequence (5.13.3 [lex.ccon]) that specifies an integer value v contributes a single code unit with a value as follows:
      • Let v be the integer value represented by the octal number comprising the sequence of octal-digits in an octal-escape-sequence or by the hexadecimal number comprising the sequence of hexadecimal-digits in a hexadecimal-escape-sequence.
      • If v does not exceed the range of representable values of the string-literal's array element type, then the value is v.
      • ...
Date: 2022-07-15.00:00:00

[Accepted at the July, 2022 meeting.]

Subclause 5.13.3 [lex.ccon] does not specify how the characters in an octal-escape-sequence or hexadecimal-escape-sequence are interpreted to obtain the integer value v that is used in bullet 3.2:

  • ...
  • A character-literal with a c-char-sequence consisting of a single numeric-escape-sequence that specifies an integer value v has a value as follows:
  • ...
History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: ready -> cd6
2022-02-25 00:00:00admincreate
2022-02-18 07:47:23adminsetmessages: + msg6748