[dcl.fct] It is unclear whether zero-size arrays in function parameters are allowed CWG 3121
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
[dcl.fct] p5 does not sufficiently clarify the following case:
void foo(int[0]);
The type of int[0] would be adjusted to int*, but since int[0] was never a valid type in the first place, there is nothing to be adjusted.
I believe that the existing wording in [dcl.array] is sufficiently clear for this to be an editorial issue. int[0] is not a valid type, so an adjustment of it cannot retroactively make it valid.
We could add the following line to the example in the mentioned paragraph:
void j(int[0]); // ill-formed
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
Review [dcl.fct] p5 alongside the existing wording in [dcl.array], focusing on the void foo(int[0]); case and the surrounding example. Clarify in the draft that the zero-size array parameter is ill-formed, then verify that the example and wording consistently communicate this.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100