Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/ub.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1281,12 +1281,12 @@

\pnum
\begin{example}
The following example assumes that \tcode{std::uint32_t} is supported\iref{cstdint.syn}.
\begin{codeblock}
int y = 1 << -1; // undefined behavior, shift is negative
std::uint32_t y = 1 << -1; // undefined behavior, shift is negative

static_assert(sizeof(int) == 4 && CHAR_BIT == 8);
int y1 = 1 << 32; // undefined behavior, shift is equal to the bit width of \tcode{int}
int y2 = 1 >> 32; // undefined behavior, shift is equal to the bit width of \tcode{int}
std::uint32_t y1 = 1 << 32; // undefined behavior, shift is equal to the bit width of \tcode{std::uint32_t}
std::uint32_t y2 = 1 >> 32; // undefined behavior, shift is equal to the bit width of \tcode{std::uint32_t}
\end{codeblock}
\end{example}

Expand Down
Loading