Skip to content

Commit e66bf8f

Browse files
Hubert Tongtkoeppe
authored andcommitted
[dcl.fct.def.delete] Make terms cover semantic deletedness
The definition of "deleted definition" in [dcl.fct.def.delete] is not written in the form of a definition and neither is the definition of "deleted function". Most problematically, these definitions encompass only the syntactic case of explicitly deleting a function but the terms are used where semantic deletedness is meant. Applying the syntactic interpretation of the definition could lead to the conclusion that the following is ill-formed: ```cpp struct A { ~A() = delete; }; struct B { A a; virtual ~B() = default; }; struct C : B { virtual ~C() = delete; }; ``` This patch changes the definitions to cover semantic deletion. **Drafting notes:** - It appears that uses of "deleted definition" in the text is usually refer to physical definitions (but not necessarily to explicit deletions). - The increased verbosity is somewhat necessary to meet the ideal that uses of a term may be replaced with the definition of the term with minimal adjustments.
1 parent 793eb7b commit e66bf8f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

source/classes.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3933,10 +3933,10 @@
39333933
\end{example}
39343934

39353935
\pnum
3936-
A function with a deleted definition\iref{dcl.fct.def} shall
3937-
not override a function that does not have a deleted definition. Likewise,
3938-
a function that does not have a deleted definition shall not override a
3939-
function with a deleted definition.%
3936+
A deleted function\iref{dcl.fct.def} shall
3937+
not override a function that is not deleted. Likewise,
3938+
a function that is not deleted shall not override a
3939+
deleted function.%
39403940
\indextext{function!virtual|)}
39413941

39423942
\pnum

source/declarations.tex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6215,12 +6215,16 @@
62156215
\indextext{definition!function!deleted}%
62166216

62176217
\pnum
6218-
A function definition whose
6218+
A \defnadj{deleted}{definition} of a function is
6219+
a function definition whose
62196220
\grammarterm{function-body}
62206221
is of the form
62216222
\tcode{= delete ;}
6222-
is called a \defnadj{deleted}{definition}. A function with a
6223-
deleted definition is also called a \defnadj{deleted}{function}.
6223+
or an explicitly-defaulted definition of the function where the function is
6224+
defined as deleted.
6225+
A \defnadj{deleted}{function} is
6226+
a function with a
6227+
deleted definition or a function that is implicitly defined as deleted.
62246228

62256229
\pnum
62266230
A program that refers to a deleted function implicitly or explicitly, other

0 commit comments

Comments
 (0)