Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2242,9 +2242,10 @@
If the lookup fails or if the deallocation function has
a deleted definition\iref{dcl.fct.def}, the program is ill-formed.
\begin{note}
This assures that a deallocation function corresponding to the dynamic type of an
object is available for the
\grammarterm{delete-expression}\iref{class.free}.
This assures that a deallocation function
is available for a \grammarterm{delete-expression}\iref{class.free},
even if the static type of the object to which the operand points
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"static type" is also a property of an expression :(
http://eel.is/c++draft/intro.defs#defns.static.type

is a base class of the object to be deleted.
\end{note}

\pnum
Expand Down
29 changes: 16 additions & 13 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
object can or cannot be aliased.
\end{footnote}
\begin{itemize}
\item the dynamic type of the object,
\item \cv{} \tcode{T}

\item a type that is the signed or unsigned type corresponding to the
dynamic type of the object, or
Expand Down Expand Up @@ -3102,10 +3102,10 @@
of the object expression is called; such a call is referred to as a
\defnx{virtual function call}{function!virtual function call}.
\begin{note}
The dynamic type is the type of the object referred to by the
current value of the object expression. \ref{class.cdtor}~describes the
behavior of virtual function calls when the object expression
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply strike the first sentence of the note instead of trying to fix it.

refers to
The dynamic type is the type of the most derived object referred to by the
current value of the object expression\iref{defns.dynamic.type}.
\ref{class.cdtor}~describes the behavior of virtual function calls
when the object expression refers to
an object under construction or destruction.
\end{note}

Expand Down Expand Up @@ -4028,10 +4028,10 @@
containing the original member, the resulting pointer to member points
to the original member. Otherwise, the behavior is undefined.
\begin{note}
Although class \tcode{B} need not contain the original member, the
dynamic type of the object with which indirection through the pointer
to member is performed must contain the original member;
see~\ref{expr.mptr.oper}.
Although class \tcode{B} need not contain the original member,
the dynamic type of the object expression
appearing in a pointer-to-member operation
must contain the original member; see~\ref{expr.mptr.oper}.
\end{note}

\pnum
Expand Down Expand Up @@ -5537,6 +5537,8 @@
type by calling the above-mentioned conversion function, and the
converted operand is used in place of the original operand for the
remainder of this subclause.
The lvalue formed by indirection of the operand is said to refer
to the object to be deleted.
In a single-object delete expression, the value of the operand of
\keyword{delete} may be a null pointer value,
a pointer value
Expand Down Expand Up @@ -5569,14 +5571,15 @@

\pnum
\indextext{\idxcode{delete}!undefined}%
In a single-object delete expression, if the static type of the object to be
deleted is not similar\iref{conv.qual} to its dynamic type
In a single-object delete expression, if the static type of the lvalue
that refers to the object to be deleted is not similar\iref{conv.qual} to its dynamic type
and the selected deallocation function (see below)
is not a destroying operator delete,
the static type shall be a base
class of the dynamic type of the object to be deleted and the static type shall
have a virtual destructor or the behavior is undefined. In an array delete
expression, if the dynamic type of the object to be deleted is not similar to
have a virtual destructor or the behavior is undefined.
In an array delete expression, if the dynamic type of the lvalue
that refers to the first element of the object to be deleted is not similar to
its static type, the behavior is undefined.

\pnum
Expand Down