Skip to content

Commit 791ff12

Browse files
authored
[expr.unary.op] Add a note about dereferencing a dangling pointer (#8130)
Dereferencing a dangling pointer to an object is valid; the resulting lvalue can be used in limited ways as per [basic.life] p8. Add a non-normative note linking the two sections.
1 parent b9a314f commit 791ff12

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/expressions.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5238,6 +5238,9 @@
52385238
the result denotes that object or function;
52395239
otherwise, the behavior is undefined except as specified in \ref{expr.typeid}.
52405240
\begin{note}
5241+
Indirection through a pointer to an out-of-lifetime object is valid\iref{basic.life}.
5242+
\end{note}
5243+
\begin{note}
52415244
\indextext{type!incomplete}%
52425245
Indirection through a pointer to an incomplete type (other than
52435246
\cv{} \keyword{void}) is valid. The lvalue thus obtained can be

0 commit comments

Comments
 (0)