Skip to content

Commit 59c54c7

Browse files
authored
Merge 2021-10 CWG Motion 4
P2316R2 Consistent character literal encoding
2 parents 69392bf + 33b408e commit 59c54c7

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

source/preprocessor.tex

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -478,32 +478,12 @@
478478
expression even though it is unsigned in translation phase
479479
7\iref{lex.phases}.
480480
\end{note}
481-
This includes interpreting \grammarterm{character-literal}s, which may involve
482-
converting escape sequences into execution character set members.
483-
Whether the numeric value for these \grammarterm{character-literal}s
484-
matches the value obtained when an identical \grammarterm{character-literal}
485-
occurs in an expression
486-
(other than within a
487-
\tcode{\#if}
488-
or
489-
\tcode{\#elif}
490-
directive)
491-
is \impldef{numeric values of \grammarterm{character-literal}s in \tcode{\#if}
492-
directives}.
481+
This includes interpreting \grammarterm{character-literal}s
482+
according to the rules in \ref{lex.ccon}.
493483
\begin{note}
494-
Thus, the constant expression in the following
495-
\tcode{\#if}
496-
directive and
497-
\keyword{if} statement\iref{stmt.if}
498-
is not guaranteed to evaluate to the same value in these two
499-
contexts:
500-
\begin{codeblock}
501-
#if 'z' - 'a' == 25
502-
if ('z' - 'a' == 25)
503-
\end{codeblock}
484+
The associated character encodings of literals are the same
485+
in \tcode{\#if} and \tcode{\#elif} directives and in any expression.
504486
\end{note}
505-
Also, whether a single-character \grammarterm{character-literal} may have a negative
506-
value is \impldef{negative value of \grammarterm{character-literal} in preprocessor}.
507487
Each subexpression with type
508488
\tcode{bool}
509489
is subjected to integral promotion before processing continues.

0 commit comments

Comments
 (0)