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.init.aggr] braced-enclosed initializer-list is never empty #2386

Closed
Rakete1111 opened this issue Nov 7, 2018 · 0 comments
Closed

[dcl.init.aggr] braced-enclosed initializer-list is never empty #2386

Rakete1111 opened this issue Nov 7, 2018 · 0 comments
Assignees

Comments

@Rakete1111
Copy link
Contributor

[dcl.init.aggr]p9 says this:

An array of unknown bound initialized with a brace-enclosed initializer-list containing n initializer-clauses, where n shall be greater than zero, is defined as having n elements.

The "where n shall be greater than zero" is unnecessary, as an initializer-list is never empty, and as such, a brace-enclosed initialize-list always has at least one element.

The restriction is also mentioned a bit later:

An empty initializer list {} shall not be used as the initializer-clause for an array of unknown bound.

I don't quite understand it (what initializer-clause?), but it seems to also disallow int a[] = {};.

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

2 participants