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

What is "it" in the definition of "usable in constant expressions" #4072

Closed
brevzin opened this issue Jul 4, 2020 · 0 comments · Fixed by #4160
Closed

What is "it" in the definition of "usable in constant expressions" #4072

brevzin opened this issue Jul 4, 2020 · 0 comments · Fixed by #4160
Assignees

Comments

@brevzin
Copy link
Contributor

brevzin commented Jul 4, 2020

We have in [expr.const]/4:

A constant-initialized potentially-constant variable is usable in constant expressions at a point P if its initializing declaration D is reachable from P and

  • (4.1) it is constexpr,
  • (4.2) it is not initialized to a TU-local value, or
  • (4.3) P is in the same translation unit as D.

There are a lot of nouns here. Which one of them does "it" refer to? I'm guessing the variable, but that takes a bit to work out, and the variable isn't even the closest noun to "it" where it is being used.

Suggestion:

A constant-initialized potentially-constant variable V is usable in constant expressions at a point P if its V's initializing declaration D is reachable from P and

  • (4.1) it V is constexpr,
  • (4.2) it V is not initialized to a TU-local value, or
  • (4.3) P is in the same translation unit as D.
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.

2 participants