Skip to content

Commit 73bb723

Browse files
burblebeetkoeppe
authored andcommitted
CWG2758 What is "access and ambiguity control"?
1 parent 667129b commit 73bb723

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

source/expressions.tex

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5790,9 +5790,12 @@
57905790
null pointer value
57915791
and the selected deallocation function (see below)
57925792
is not a destroying operator delete,
5793-
the \grammarterm{delete-expression} will invoke the
5793+
evaluating the \grammarterm{delete-expression} invokes the
57945794
destructor (if any) for the object or the elements of the array being
5795-
deleted. In the case of an array, the elements will be destroyed in
5795+
deleted.
5796+
The destructor shall be accessible from the point where
5797+
the \grammarterm{delete-expression} appears.
5798+
In the case of an array, the elements are destroyed in
57965799
order of decreasing address (that is, in reverse order of the completion
57975800
of their constructor; see~\ref{class.base.init}).
57985801

@@ -5873,8 +5876,7 @@
58735876
\end{note}
58745877

58755878
\pnum
5876-
If more than one deallocation function is found,
5877-
the function to be called is selected as follows:
5879+
The deallocation the function to be called is selected as follows:
58785880
\begin{itemize}
58795881
\item
58805882
If any of the deallocation functions is a destroying operator delete,
@@ -5903,6 +5905,10 @@
59035905
whether a deallocation function with a parameter of type \tcode{std::size_t}
59045906
is selected.
59055907
\end{itemize}
5908+
Unless the deallocation function is selected
5909+
at the point of definition of the dynamic type's virtual destructor,
5910+
the selected deallocation function shall be accessible
5911+
from the point where the \grammarterm{delete-expression} appears.
59065912

59075913
\pnum
59085914
For a single-object delete expression,
@@ -5956,10 +5962,6 @@
59565962
the behavior is undefined\iref{new.delete.single,new.delete.array}.
59575963
\end{note}
59585964

5959-
\pnum
5960-
Access and ambiguity control are done for both the deallocation function
5961-
and the destructor\iref{class.dtor,class.free}.
5962-
59635965
\rSec2[expr.cast]{Explicit type conversion (cast notation)}%
59645966
\indextext{expression!cast|(}
59655967

0 commit comments

Comments
 (0)