Skip to content

Commit 13355ba

Browse files
burblebeetkoeppe
authored andcommitted
CWG2698 Using extended integer types with z suffix
1 parent 7f17f18 commit 13355ba

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

source/lex.tex

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,21 +1317,27 @@
13171317
\end{floattable}
13181318

13191319
\pnum
1320-
If an \grammarterm{integer-literal}
1320+
Except for \grammarterm{integer-literal}{s} containing
1321+
a \grammarterm{size-suffix},
1322+
if the value of an \grammarterm{integer-literal}
13211323
cannot be represented by any type in its list and
13221324
an extended integer type\iref{basic.fundamental} can represent its value,
13231325
it may have that extended integer type.
13241326
If all of the types in the list for the \grammarterm{integer-literal}
13251327
are signed,
1326-
the extended integer type shall be signed.
1328+
the extended integer type is signed.
13271329
If all of the types in the list for the \grammarterm{integer-literal}
13281330
are unsigned,
1329-
the extended integer type shall be unsigned.
1331+
the extended integer type is unsigned.
13301332
If the list contains both signed and unsigned types,
13311333
the extended integer type may be signed or unsigned.
1332-
A program is ill-formed
1333-
if one of its translation units contains an \grammarterm{integer-literal}
1334-
that cannot be represented by any of the allowed types.
1334+
If an \grammarterm{integer-literal}
1335+
cannot be represented by any of the allowed types,
1336+
the program is ill-formed.
1337+
\begin{note}
1338+
An \grammarterm{integer-literal} with a \tcode{z} or \tcode{Z} suffix
1339+
is ill-formed if it cannot be represented by \tcode{std::size_t}.
1340+
\end{note}
13351341

13361342
\rSec2[lex.ccon]{Character literals}
13371343

0 commit comments

Comments
 (0)