[expr.static.cast] unclear reference "range of the enumeration values" to defined term "values of the enumeration"
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
[expr.static.cast]/8 says in part:
If the enumeration type does not have a fixed underlying type, the value is unchanged if the original value is within the range of the enumeration values ([dcl.enum]), and otherwise, the behavior is undefined.
This is referring to a defined term in [dcl.enum]/8:
For an enumeration whose underlying type is fixed, the values of the enumeration are the values of the underlying type. Otherwise, the values of the enumeration are the values representable by a hypothetical integer type with minimal width M such that all enumerators can be represented. The width of the smallest bit-field large enough to hold all the values of the enumeration type is M. It is possible to define an enumeration that has values not defined by any of its enumerators. If the enumerator-list is empty, the values of the enumeration are as if the enumeration had a single enumerator with value 0.
Unfortunately, the reference to "range of the enumeration values" doesn't use the same term as is defined in [dcl.enum]/8, although we can see from CWG1766 that it was intended to refer to that definition. As it stands, there's even potential for confusion here: "range of the enumeration values" could be taken to mean the range of representable values of the underlying type, which in the case in question (where the underlying type is not fixed) is likely to be a superset of the values of the enumeration.
Suggestion: the minimal fix would be to replace "within the range of the enumeration values" to "within the range of the values of the enumeration". Although perhaps dropping "the range of" would also be a nice simplification, since the values of the enumeration are always a contiguous set of integers anyway.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the draft text for [expr.static.cast]/8 and compare its wording with the defined term in [dcl.enum]/8. Update the reference so it clearly uses the defined phrase "values of the enumeration," then verify that the affected sentence reads consistently with the surrounding standard text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- tex
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100