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

2024-10-26


2691. hexadecimal-escape-sequence is too greedy

Section: 5.13.3  [lex.ccon]     Status: C++23     Submitter: Fraser Gordon     Date: 2023-01-26

[Accepted at the February, 2023 meeting.]

The lexer grammar production hexadecimal-escape-sequence matches text of the form \x{20}ab due to its recursive definition.

Proposed resolution (approved by CWG 2023-01-27):

Change in 5.13.3 [lex.ccon] as follows:

hexadecimal-escape-sequence :
     \x hexadecimal-digit simple-hexadecimal-digit-sequence
     hexadecimal-escape-sequence hexadecimal-digit
     \x{ simple-hexadecimal-digit-sequence }