Title
Brace initializer for scalar
Status
dup
Section
9.4 [dcl.init]
Submitter
Steve Clamage

Created on 1999-08-12.00:00:00 last changed 193 months ago

Messages

Date: 2008-05-15.00:00:00

Rationale (May, 2008):

Issue 632 refers to exactly the same question and has a more detailed discussion of the considerations involved.

Date: 2022-11-20.07:54:16

It is not clear whether the following declaration is well-formed:

    struct S { int i; } s = { { 1 } };
According to 9.4.2 [dcl.init.aggr] paragraph 2, a brace-enclosed initializer is permitted for a subaggregate of an aggregate; however, i is a scalar, not an aggregate. 9.4 [dcl.init] paragraph 13 says that a standalone declaration like
    int i = { 1 };
is permitted, but it is not clear whether this says anything about the form of initializers for scalar members of aggregates.

This is (more) clearly permitted by the C89 Standard.

History
Date User Action Args
2008-05-18 00:00:00adminsetstatus: open -> dup
2000-11-18 00:00:00adminsetmessages: + msg426
1999-08-12 00:00:00admincreate