Skip to content

[dcl.fct] It is unclear whether zero-size arrays in function parameters are allowed #6575

@Eisenwave

Description

@Eisenwave

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions