Skip to content

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

Closed
@xmh0511

Description

@xmh0511

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

Activity

jensmaurer

jensmaurer commented on Apr 2, 2021

@jensmaurer
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.

self-assigned this
on Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @xmh0511@jensmaurer

    Issue actions

      [dcl.init.aggr] Inconsistent meaning of initializer list · Issue #4571 · cplusplus/draft