|
6331 | 6331 | \opt{ctor-initializer} compound-statement\br
|
6332 | 6332 | function-try-block\br
|
6333 | 6333 | \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{;} |
6335 | 6341 | \end{bnf}
|
6336 | 6342 |
|
6337 | 6343 | Any informal reference to the body of a function should be interpreted as a reference to
|
|
6589 | 6595 | \indextext{definition!function!deleted}%
|
6590 | 6596 |
|
6591 | 6597 | \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} |
6597 | 6600 | or an explicitly-defaulted definition of the function where the function is
|
6598 | 6601 | defined as deleted.
|
6599 | 6602 | A \defnadj{deleted}{function} is
|
|
6603 | 6606 | \pnum
|
6604 | 6607 | A program that refers to a deleted function implicitly or explicitly, other
|
6605 | 6608 | 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 | + |
6606 | 6615 | \begin{note}
|
6607 | 6616 | This includes calling the function
|
6608 | 6617 | implicitly or explicitly and forming a pointer or pointer-to-member to the
|
|
6611 | 6620 | function selected by overload resolution is referenced. The implicit
|
6612 | 6621 | odr-use\iref{term.odr.use} of a virtual function does not, by itself,
|
6613 | 6622 | 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. |
6614 | 6626 | \end{note}
|
6615 | 6627 |
|
6616 | 6628 | \pnum
|
|
0 commit comments