Skip to content

[basic.life] Remove a partial repetition of the end-of-lifetime rules #4894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 21, 2021
Merged
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
18 changes: 8 additions & 10 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3350,16 +3350,14 @@
\end{note}

\pnum
A program may end the lifetime of any object by reusing the storage
which the object occupies or by explicitly calling a destructor
or pseudo-destructor\iref{expr.prim.id.dtor} for the object.
For an object of a class type, the program is not required to
call the destructor explicitly before the storage which the object
occupies is reused or released; however, if there is no explicit call to
the destructor or if a \grammarterm{delete-expression}\iref{expr.delete}
is not used to release the storage, the destructor is not
implicitly called and any program that depends on the side effects
produced by the destructor has undefined behavior.
A program may end the lifetime of an object of class type without invoking the
destructor, by reusing or releasing the storage as described above.
\begin{note}
A \grammarterm{delete-expression}\iref{expr.delete} invokes the destructor
prior to releasing the storage.
\end{note}
In this case, the destructor is not implicitly invoked and any program that
depends on the side effects produced by the destructor has undefined behavior.

\pnum
Before the lifetime of an object has started but after the storage which
Expand Down