Skip to content

Commit faa572d

Browse files
authored
Merge 2024-03 CWG Motion 9
P2573R2 = delete("should have a reason");
2 parents cf52398 + 74fdf3b commit faa572d

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
@@ -6331,7 +6331,13 @@
63316331
\opt{ctor-initializer} compound-statement\br
63326332
function-try-block\br
63336333
\terminal{=} \keyword{default} \terminal{;}\br
6334-
\terminal{=} \keyword{delete} \terminal{;}
6334+
deleted-function-body
6335+
\end{bnf}
6336+
6337+
\begin{bnf}
6338+
\nontermdef{deleted-function-body}\br
6339+
\terminal{=} \keyword{delete} \terminal{;}\br
6340+
\terminal{=} \keyword{delete} \terminal{(} unevaluated-string \terminal{)} \terminal{;}
63356341
\end{bnf}
63366342

63376343
Any informal reference to the body of a function should be interpreted as a reference to
@@ -6589,11 +6595,8 @@
65896595
\indextext{definition!function!deleted}%
65906596

65916597
\pnum
6592-
A \defnadj{deleted}{definition} of a function is
6593-
a function definition whose
6594-
\grammarterm{function-body}
6595-
is of the form
6596-
\tcode{= delete ;}
6598+
A \defnadj{deleted}{definition} of a function is a function definition
6599+
whose \grammarterm{function-body} is a \grammarterm{deleted-function-body}
65976600
or an explicitly-defaulted definition of the function where the function is
65986601
defined as deleted.
65996602
A \defnadj{deleted}{function} is
@@ -6603,6 +6606,12 @@
66036606
\pnum
66046607
A program that refers to a deleted function implicitly or explicitly, other
66056608
than to declare it, is ill-formed.
6609+
6610+
\recommended
6611+
The resulting diagnostic message should include
6612+
the text of the \grammarterm{unevaluated-string},
6613+
if one is supplied.
6614+
66066615
\begin{note}
66076616
This includes calling the function
66086617
implicitly or explicitly and forming a pointer or pointer-to-member to the
@@ -6611,6 +6620,9 @@
66116620
function selected by overload resolution is referenced. The implicit
66126621
odr-use\iref{term.odr.use} of a virtual function does not, by itself,
66136622
constitute a reference.
6623+
The \grammarterm{unevaluated-string}, if present,
6624+
can be used to explain the rationale for deletion and/or
6625+
to suggest an alternative.
66146626
\end{note}
66156627

66166628
\pnum

source/preprocessor.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,6 +1857,7 @@
18571857
\defnxname{cpp_decltype_auto} & \tcode{201304L} \\ \rowsep
18581858
\defnxname{cpp_deduction_guides} & \tcode{201907L} \\ \rowsep
18591859
\defnxname{cpp_delegating_constructors} & \tcode{200604L} \\ \rowsep
1860+
\defnxname{cpp_deleted_function} & \tcode{202403L} \\ \rowsep
18601861
\defnxname{cpp_designated_initializers} & \tcode{201707L} \\ \rowsep
18611862
\defnxname{cpp_enumerator_attributes} & \tcode{201411L} \\ \rowsep
18621863
\defnxname{cpp_explicit_this_parameter} & \tcode{202110L} \\ \rowsep

0 commit comments

Comments
 (0)