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] Inconsistent meaning of initializer list #4571

Closed
xmh0511 opened this issue Apr 2, 2021 · 1 comment · Fixed by #4574
Closed

[dcl.init.aggr] Inconsistent meaning of initializer list #4571

xmh0511 opened this issue Apr 2, 2021 · 1 comment · Fixed by #4574
Assignees

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Apr 2, 2021

List-initialization is initialization of an object or reference from a braced-init-list. Such an initializer is called an initializer list, and the comma-separated initializer-clauses of the initializer-list or designated-initializer-clauses of the designated-initializer-list are called the elements of the initializer list.

That hints that the component braced-init-list is called an initializer list.

However, in section [dcl.init.aggr], there are several components that are not braced-init-list are called initializer list. List in the following:
[dcl.init.aggr#3.1]

If the initializer list is a designated-initializer-list ...

[dcl.init.aggr#3.2]

If the initializer list is an initializer-list...

[dcl.init.aggr#4.1]

the initializer list is a designated-initializer-list...

Should we only say that it's an initializer list by using braces to enclose them? Such as {initializer-list}, {designated-initializer-list}

As a contrast
[dcl.init.aggr#3.3]

Otherwise, the initializer list must be {}...

Which is a kind of braced-init-list. So it's called initializer list

@jensmaurer
Copy link
Member

So, the complaint here is that "initializer list" (prose text) is defined to refer to a brace-enclosed list of things, but dcl.init.aggr uses it incorrectly to refer to the list of elements (without the enclosing braces). There is also the additional issue of the optional trailing comma in either case.

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