Skip to content

Commit 877d6dd

Browse files
committed
P2573R2 = delete("should have a reason");
1 parent 9ec133c commit 877d6dd

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

source/declarations.tex

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6249,7 +6249,13 @@
62496249
\opt{ctor-initializer} compound-statement\br
62506250
function-try-block\br
62516251
\terminal{=} \keyword{default} \terminal{;}\br
6252-
\terminal{=} \keyword{delete} \terminal{;}
6252+
deleted-function-body
6253+
\end{bnf}
6254+
6255+
\begin{bnf}
6256+
\nontermdef{deleted-function-body}\br
6257+
\terminal{=} \keyword{delete} \terminal{;}\br
6258+
\terminal{=} \keyword{delete} \terminal{(} unevaluated-string \terminal{)} \terminal{;}
62536259
\end{bnf}
62546260

62556261
Any informal reference to the body of a function should be interpreted as a reference to
@@ -6502,11 +6508,8 @@
65026508
\indextext{definition!function!deleted}%
65036509

65046510
\pnum
6505-
A \defnadj{deleted}{definition} of a function is
6506-
a function definition whose
6507-
\grammarterm{function-body}
6508-
is of the form
6509-
\tcode{= delete ;}
6511+
A \defnadj{deleted}{definition} of a function is a function definition
6512+
whose \grammarterm{function-body} is a \grammarterm{deleted-function-body}
65106513
or an explicitly-defaulted definition of the function where the function is
65116514
defined as deleted.
65126515
A \defnadj{deleted}{function} is
@@ -6516,6 +6519,12 @@
65166519
\pnum
65176520
A program that refers to a deleted function implicitly or explicitly, other
65186521
than to declare it, is ill-formed.
6522+
6523+
\recommended
6524+
The resulting diagnostic message should include
6525+
the text of the \grammarterm{unevaluated-string},
6526+
if one is supplied.
6527+
65196528
\begin{note}
65206529
This includes calling the function
65216530
implicitly or explicitly and forming a pointer or pointer-to-member to the
@@ -6524,6 +6533,9 @@
65246533
function selected by overload resolution is referenced. The implicit
65256534
odr-use\iref{term.odr.use} of a virtual function does not, by itself,
65266535
constitute a reference.
6536+
The \grammarterm{unevaluated-string}, if present,
6537+
can be used to explain the rationale for deletion and/or
6538+
to suggest an alternative.
65276539
\end{note}
65286540

65296541
\pnum

source/preprocessor.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,6 +1825,7 @@
18251825
\defnxname{cpp_decltype_auto} & \tcode{201304L} \\ \rowsep
18261826
\defnxname{cpp_deduction_guides} & \tcode{201907L} \\ \rowsep
18271827
\defnxname{cpp_delegating_constructors} & \tcode{200604L} \\ \rowsep
1828+
\defnxname{cpp_deleted_function} & \tcode{202403L} \\ \rowsep
18281829
\defnxname{cpp_designated_initializers} & \tcode{201707L} \\ \rowsep
18291830
\defnxname{cpp_enumerator_attributes} & \tcode{201411L} \\ \rowsep
18301831
\defnxname{cpp_explicit_this_parameter} & \tcode{202110L} \\ \rowsep

0 commit comments

Comments
 (0)