Skip to content
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

[class.temporary]/3 A deleted destructor is meaninglessly allowed #4551

Open
frederick-vs-ja opened this issue Mar 19, 2021 · 3 comments
Open
Labels
cwg Issue must be reviewed by CWG.

Comments

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Mar 19, 2021

If a parameter type (that is an object type) or the return type of a function has a deleted destructor, the function definition or the return statement is ill-formed respectively (the latter case is banned via CWG 2426). So should we just say "the destructor of X is trivial"?

@jensmaurer
Copy link
Member

jensmaurer commented Mar 19, 2021

We don't ban function definitions where an involved object has a deleted destructor, we just ban passing arguments in an actual call (because we specify destruction of the parameter objects) and we ban return statements for objects with a deleted destructor. If a function doesn't have a return statement (maybe because it contains an endless loop) or if we never call the function, it seems we're fine. The provision in [class.temporary]p3 might be needed when compiling the function definition, though.

@zygoloid, what do you think?

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Apr 2, 2021
@jensmaurer
Copy link
Member

Editorial meeting 2021-04-16: You can define a function with a return type with a deleted destructor, if that function never returns.
Suggestion: Drop "or deleted" for the destructor. @tkoeppe to send e-mail to the CWG reflector.

@jensmaurer jensmaurer added cwg Issue must be reviewed by CWG. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Apr 16, 2021
@tkoeppe
Copy link
Contributor

tkoeppe commented Apr 30, 2021

Sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG.
Projects
None yet
Development

No branches or pull requests

3 participants