Skip to content

[expr.delete] Properly italicize the term 'delete array', as done elsewhere #1532

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 1 commit into from
Nov 22, 2017
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
43 changes: 21 additions & 22 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4136,11 +4136,13 @@
\terminal{::}\opt{} \terminal{delete [ ]} cast-expression
\end{bnf}

The first alternative is for non-array objects, and the second is for arrays. Whenever
the \tcode{delete} keyword is immediately followed by empty square brackets, it shall be
interpreted as the second alternative.\footnote{A lambda expression with a
\grammarterm{lambda-introducer} that consists of
empty square brackets can follow the \tcode{delete} keyword if the lambda expression is
The first alternative is a
\defnx{single-object delete expression}{delete!single-object}, and the
second is an \defnx{array delete expression}{delete!array}.
Whenever the \tcode{delete} keyword is immediately followed by empty square
brackets, it shall be interpreted as the second alternative.\footnote{A lambda
expression with a \grammarterm{lambda-introducer} that consists of empty square
brackets can follow the \tcode{delete} keyword if the lambda expression is
enclosed in parentheses.}
The operand shall be of pointer to object type or of class type. If of
class type, the operand is contextually implicitly converted\iref{conv}
Expand All @@ -4152,23 +4154,20 @@
\tcode{void}.

\pnum
\indextext{\idxcode{delete}!object}%
\indextext{\idxcode{delete}!single-object}%
If the operand has a class type, the operand is converted to a pointer
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.
In the first alternative
(\defnx{delete object}{object!delete}), the value of the operand of \tcode{delete} may
be a null pointer value, a pointer to a non-array object
In a single-object delete expression, the value of the operand of
\tcode{delete} may be a null pointer value, a pointer to a non-array object
created by a previous \grammarterm{new-expression},
or a pointer to a
subobject\iref{intro.object} representing a base class of such an
object\iref{class.derived}. If not, the behavior is undefined.
\indextext{array!\idxcode{delete}}%
In the second alternative (\defnx{delete array}{\idxcode{delete}!array}), the value of the
operand of \tcode{delete}
may be a null pointer value or a pointer value
that resulted from
In an array delete expression, the value of the operand of \tcode{delete}
may be a null pointer value or a pointer value that resulted from
a previous array \grammarterm{new-expression}.\footnote{For nonzero-length
arrays, this is the same as a pointer to the first
element of the array created by that \grammarterm{new-expression}.
Expand All @@ -4188,12 +4187,12 @@

\pnum
\indextext{\idxcode{delete}!undefined}%
In the first alternative (\term{delete object}), if the static type of
the object to be deleted is different from its dynamic type, 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 the second
alternative (\term{delete array}) if the dynamic type of the object to
be deleted differs from its static type, the behavior is undefined.
In a single-object delete expression, if the static type of the object to be
deleted is different from its dynamic type, 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 differs from its
static type, the behavior is undefined.

\pnum
The \grammarterm{cast-expression} in a \grammarterm{delete-expression} shall
Expand Down Expand Up @@ -4298,9 +4297,9 @@
\pnum
When a \grammarterm{delete-expression}
is executed, the selected deallocation function shall be called with
the address of the most-derived object in the \term{delete object} case, or
the address of the object suitably adjusted for
the array allocation overhead\iref{expr.new} in the \term{delete array} case,
the address of the most-derived object in a single-object delete expression, or
the address of the object suitably adjusted for the array allocation
overhead\iref{expr.new} in an array delete expression,
as its first argument.
If a deallocation function
with a parameter of type \tcode{std::align_val_t}
Expand Down