diff --git a/source/basic.tex b/source/basic.tex index 4ba58bb4e7..abc0f1740b 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3622,22 +3622,21 @@ \end{note} \pnum -If a program ends the lifetime of an object of type \tcode{T} with -static\iref{basic.stc.static}, thread\iref{basic.stc.thread}, -or automatic\iref{basic.stc.auto} -storage duration and if \tcode{T} has a non-trivial destructor, +\begin{note} +If a program ends the lifetime of an object for which a destructor +will be called implicitly, \begin{footnote} -That -is, an object for which a destructor will be called -implicitly---upon exit from the block for an object with -automatic storage duration, upon exit from the thread for an object with -thread storage duration, or upon exit from the program for an object -with static storage duration. +The destructor will be called upon exit from the block for an object with +automatic storage duration\iref{basic.stc.auto}, upon exit from the thread +for an object with thread storage duration\iref{basic.stc.thread}, or upon +exit from the program for an object with +static storage duration\iref{basic.stc.static}. \end{footnote} -and another object of the original type does not occupy -that same storage location when the implicit destructor call takes -place, the behavior of the program is undefined. This is true -even if the block is exited with an exception. +and the object is not transparently replaceable by another object that is +within its lifetime when the implicit destructor call takes place, +the behavior of the program is undefined. This is true even if the block is +exited with an exception. +\end{note} \begin{example} \begin{codeblock} class T { }; diff --git a/source/classes.tex b/source/classes.tex index 39c538ecbd..2bf59f37aa 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -2270,9 +2270,11 @@ \end{note} \pnum +\begin{note} Once a destructor is invoked for an object, the object's lifetime ends; the behavior is undefined if the destructor is invoked for an object whose lifetime has ended\iref{basic.life}. +\end{note} \begin{example} If the destructor for an object with automatic storage duration is explicitly invoked, and the block is subsequently left in a manner that would ordinarily