C++ Logo

std-discussion

Advanced search

Character literals

From: Russell Shaw <rjshaw_at_[hidden]>
Date: Thu, 14 Aug 2025 20:27:47 +1000
Hi,

In [lex.ccon]:

--------------------------------------------------
character-literal :
   encoding-prefixopt ’ c-char-sequence ’

encoding-prefix : one of
   u8 u U L

c-char-sequence :
   c-char
   c-char-sequence c-char

c-char :
   basic-c-char
   escape-sequence
   universal-character-name

escape-sequence :
   simple-escape-sequence
   numeric-escape-sequence
   conditional-escape-sequence

numeric-escape-sequence :
   octal-escape-sequence
   hexadecimal-escape-sequence

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

--------------------------------------------------

The line at AA is an unbounded sequence.

That doesn't really make sense because the loop implies multiple such
hexadecimal-escape-sequences:

c-char-sequence :
   c-char
   c-char-sequence c-char

Received on 2025-08-14 10:27:56