Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit acd2c81

Browse files
burblebeetkoeppe
authored andcommittedNov 21, 2022
CWG2627 Bit-fields and narrowing conversions
1 parent 68653fc commit acd2c81

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
 

‎source/declarations.tex

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5993,8 +5993,18 @@
59935993
original type, or
59945994

59955995
\item from an integer type or unscoped enumeration type to an integer type that cannot
5996-
represent all the values of the original type, except where the source is a constant
5996+
represent all the values of the original type, except where
5997+
\begin{itemize}
5998+
\item
5999+
the source is a bit-field whose width $w$ is less than that of its type
6000+
(or, for an enumeration type, its underlying type) and
6001+
the target type can represent all the values
6002+
of a hypothetical extended integer type
6003+
with width $w$ and with the same signedness as the original type or
6004+
\item
6005+
the source is a constant
59976006
expression whose value after integral promotions will fit into the target type, or
6007+
\end{itemize}
59986008

59996009
\item from a pointer type or a pointer-to-member type to \tcode{bool}.
60006010
\end{itemize}

0 commit comments

Comments
 (0)
Please sign in to comment.