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

[dcl.constexpr] awkward grammar in resolution of CWG2602 #6113

Open
zygoloid opened this issue Feb 13, 2023 · 0 comments
Open

[dcl.constexpr] awkward grammar in resolution of CWG2602 #6113

zygoloid opened this issue Feb 13, 2023 · 0 comments

Comments

@zygoloid
Copy link
Member

CWG2602 asks for this text in [dcl.constexpr]/3:

A function is constexpr-suitable if:

  • it is not a coroutine (9.5.4 [dcl.fct.def.coroutine]), and
  • if the function is a constructor or destructor, its class does not have any virtual base classes.

The second bullet does fit well into the enclosing context ("A function is constexpr-suitable if, [...] if the function [...]"). This would be easier to read if rephrased:

A function is constexpr-suitable if:

  • it is not a coroutine (9.5.4 [dcl.fct.def.coroutine]), and
  • if the function either it is not a constructor or destructor, or its class does not have any virtual base classes.

or

A function is constexpr-suitable if:

  • it is not a coroutine (9.5.4 [dcl.fct.def.coroutine]), and
  • if the function it is not a constructor or destructor, its of a class does not have any with virtual base classes.
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

No branches or pull requests

1 participant