Skip to content

Commit 2a61312

Browse files
committed
[ub] Remove lifetime.outside.pointer.static.cast
This UB was removed in Kona 2025.
1 parent ecdd477 commit 2a61312

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

source/ub.tex

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -178,33 +178,6 @@
178178
\end{codeblock}
179179
\end{example}
180180

181-
\pnum
182-
\ubxref{lifetime.outside.pointer.static.cast}
183-
For a pointer pointing to an object outside of its lifetime, behavior is
184-
undefined if the pointer is used as the operand of a
185-
\tcode{static_cast}, except when the conversion
186-
is to pointer to \cv{}~\tcode{void}, or to pointer to \cv{}~\tcode{void}
187-
and subsequently to pointer to
188-
\cv{}~\tcode{char},
189-
\cv{}~\tcode{unsigned char}, or
190-
\cv{}~\tcode{std::byte}\iref{cstddef.syn}.
191-
192-
\pnum
193-
\begin{example}
194-
\begin{codeblock}
195-
struct B {};
196-
struct D : B {};
197-
void f()
198-
{
199-
D d;
200-
B* bp = &d;
201-
d.~D();
202-
void* vp = bp; // OK
203-
D* dp = static_cast<D*>(bp); // undefined behavior
204-
}
205-
\end{codeblock}
206-
\end{example}
207-
208181
\pnum
209182
\ubxref{lifetime.outside.pointer.dynamic.cast}
210183
For a pointer pointing to an object outside of its lifetime, behavior is

0 commit comments

Comments
 (0)