<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2540</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="2540"></A><H4>2540.
  
Unspecified interpretation of <I>numeric-escape-sequence</I>
</H4>
<B>Section: </B>5.13.3&#160; [<A href="https://wg21.link/lex.ccon">lex.ccon</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD6
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2022-02-25<BR>


<P>[Accepted at the July, 2022 meeting.]</P>

<P>Subclause 5.13.3 [<A href="https://wg21.link/lex.ccon">lex.ccon</A>] does not specify how the
characters in an <I>octal-escape-sequence</I>
or <I>hexadecimal-escape-sequence</I> are interpreted to obtain the
integer value <I>v</I> that is used in bullet 3.2:</P>

<BLOCKQUOTE>

<UL>
<LI>...</LI>
<LI>
A <I>character-literal</I> with a <I>c-char-sequence</I> consisting of
a single <I>numeric-escape-sequence</I> that specifies an integer
value <I>v</I> has a value as follows:
</LI>
<LI>...</LI>
</UL>

</BLOCKQUOTE>

<P><B>Proposed resolution (approved by CWG 2022-03-11):</B></P>

<OL>
<LI>
Change in 5.13.3 [<A href="https://wg21.link/lex.ccon#3.2">lex.ccon</A>] bullet 3.2 as follows:

<BLOCKQUOTE>

<UL>
<LI>
A <I>character-literal</I> with a <I>c-char-sequence</I> consisting of
a single <I>numeric-escape-sequence</I> <DEL>that specifies an integer
value <I>v</I></DEL> has a value as follows:
<UL>
<LI><INS>Let <I>v</I> be the integer value represented by the octal
number comprising the sequence of <I>octal-digit</I>s in
an <I>octal-escape-sequence</I> or by the hexadecimal number
comprising the sequence of <I>hexadecimal-digit</I>s in
a <I>hexadecimal-escape-sequence</I>.</INS></LI>

<LI>If <I>v</I> does not exceed the range of representable values of
the character-literal's type, then the value is <I>v</I>.
</LI>
<LI>...</LI>
</UL>
</LI>

</UL>

</BLOCKQUOTE>
</LI>

<LI>
Change in 5.13.5 [<A href="https://wg21.link/lex.string#10.2">lex.string</A>] bullet 10.2 as follows:

<BLOCKQUOTE>

<UL>
<LI>
Each <I>numeric-escape-sequence</I> (5.13.3 [<A href="https://wg21.link/lex.ccon">lex.ccon</A>])
<DEL>that specifies an integer value <I>v</I></DEL> contributes a
single code unit with a value as follows:
<UL>
<LI><INS>Let <I>v</I> be the integer value represented by the octal
number comprising the sequence of <I>octal-digit</I>s in
an <I>octal-escape-sequence</I> or by the hexadecimal number
comprising the sequence of <I>hexadecimal-digit</I>s in
a <I>hexadecimal-escape-sequence</I>.</INS></LI>

<LI>If <I>v</I> does not exceed the range of representable values of
the <I>string-literal</I>'s array element type, then the value
is <I>v</I>.</LI>

<LI>...</LI>
</UL>
</LI>
</UL>

</BLOCKQUOTE>
</LI>
</OL>

<BR><BR>
</BODY>
</HTML>
