From 2f4c15010ce941e56dec77bd9a8edc0a7f72f2ea Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Tue, 30 Dec 2025 09:35:23 -0500 Subject: [PATCH] [lex.phases] Do not recognize UCNs in d-char sequences We do not recognize universal-character-names when lexing character sequences for literals, and that should include d-char-sequences for raw string literals. Note that d-char-sequences are limited to a subset of the basic character set that excludes the \ that would mark the start of a universal-character-name, but if we recognized the UCN then that \ would be consumed when recognizing the universal-character-name, and the transformed character would then be ill-formed as either not a member of the basic character set, or as a UCN denoting an element of the basic character set. Rather than creating such an obscure error condition, it is simpler to not recognize UCNs for d-char-sequences just as we do not for any other character sequence and diagnose a more consistent error. --- source/lex.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/lex.tex b/source/lex.tex index ed45edd697..99d595af28 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -139,6 +139,7 @@ except when matching a \grammarterm{c-char-sequence}, \grammarterm{s-char-sequence}, +\grammarterm{d-char-sequence}, \grammarterm{r-char-sequence}, \grammarterm{h-char-sequence}, or \grammarterm{q-char-sequence},