C++ Logo


Advanced search

Re: What is the meaning of expr-or-braced-init-list in the grammar of the term initializer?

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Tue, 27 Jul 2021 14:56:26 -0400
On Tue, Jul 27, 2021 at 2:13 PM Vladimir Grigoriev via Std-Discussion
<std-discussion_at_[hidden]> wrote:
> I mean that when somebody reads the section Ā«InitializersĀ» it is entirely unclear why there is the definition of expr-or-braced-init-list that is not related to any other parts of the definition of the initializer.
> Either there is must be a production that leads to this definition or there must be a reference to the grammar in the C++ Standard where a more complete definition is present.

There are certain places in grammar where an expression or
braced-init-list is used. All of those places (`return/co_return`,
subscript operators, etc) ultimately involve using the
expression/braced-int-list to initialize an object of some type.

Are you saying that a grammatical construct used for initializing
objects *shouldn't* be defined in the section titled "Initializers"?
And if not, where should it be defined? None of the places where it
gets used are appropriate. It's got to go somewhere, and this makes
more sense than any other place.

This criticism seems decidedly pointless.

Received on 2021-07-27 13:56:39