From 0de9d25aabe100d1f3c6c1840403e7aa682e5c2b Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Thu, 20 Jul 2023 00:04:11 +0800 Subject: [PATCH 1/2] [basic.life] Turn the normatively redundant paragraph into a note --- source/basic.tex | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) 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 { }; From ca50a70e0d50ef658a88fe7f1af5c8454e653a5f Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Thu, 20 Jul 2023 00:13:06 +0800 Subject: [PATCH 2/2] [class.dtor] Turn the normatively redundant paragraph into a note --- source/classes.tex | 2 ++ 1 file changed, 2 insertions(+) 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