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.prop] ambiguous conditions in definition of implicit-lifetime class #5318

Closed
jwakely opened this issue Feb 24, 2022 · 4 comments · Fixed by #5319
Closed

[class.prop] ambiguous conditions in definition of implicit-lifetime class #5318

jwakely opened this issue Feb 24, 2022 · 4 comments · Fixed by #5319
Assignees

Comments

@jwakely
Copy link
Member

jwakely commented Feb 24, 2022

A class S is an implicit-lifetime class if it is an aggregate or has at least one trivial eligible constructor and a trivial, non-deleted destructor.

It's ambiguous whether this means (A || (B && C)) or ((A || B) && C).

How about:

A class S is an implicit-lifetime class if it has a trivial, non-deleted destructor and either it is an aggregate or it has at least one trivial eligible constructor.

@jensmaurer jensmaurer self-assigned this Feb 24, 2022
@jensmaurer
Copy link
Member

The problem is that the omission of words in the English phrasing "or has X and Y" leads me to believe that "and" binds more tightly here than the "or". I'm wary of introducing a silent semantic change.

@jensmaurer
Copy link
Member

@zygoloid , what did you intend here?

@jwakely
Copy link
Member Author

jwakely commented Feb 24, 2022

I don't think an aggregate with a non-trivial destructor can be an implicit-lifetime type, can it?

@opensdh
Copy link
Contributor

opensdh commented Jun 27, 2022

I don't think an aggregate with a non-trivial destructor can be an implicit-lifetime type, can it?

It probably shouldn't be, but there was actually only one way to parse the sentence in question (because "a trivial, non-deleted destructor" is merely a noun phrase).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants