New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dcl.fct.def.delete] Make terms cover semantic deletedness #3952
[dcl.fct.def.delete] Make terms cover semantic deletedness #3952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like an improvement to me.
When we talk about "delete function", we don't care how it ends up being deleted.
abe7b94
to
486d813
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs squashing; looks good
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.
486d813
to
1836b20
Compare
Ping @zygoloid. |
@tkoeppe, this looks ready to go. |
Great, thanks! |
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:
This patch changes the definitions to cover semantic deletion.
Drafting notes: