Title
Parenthesized initialization of arrays
Status
drwp
Section
9.4.1 [dcl.init.general]
Submitter
Mike Miller

Created on 2023-03-14.00:00:00 last changed 12 months ago

Messages

Date: 2023-04-28.19:41:23

Proposed resolution (approved by CWG 2023-04-28):

Change in 9.4.1 [dcl.init.general] paragraph 13 as follows:

If the entity being initialized does not have class or array type, the expression-list in a parenthesized initializer shall be a single expression.
Date: 2023-06-15.00:00:00

[Accepted as a DR at the June, 2023 meeting.]

Consider:

  const int arr[2](1,2);

This is accepted by all major implementations, yet 9.4.1 [dcl.init.general] paragraph 13 prohibits it:

If the entity being initialized does not have class type, the expression-list in a parenthesized initializer shall be a single expression.

Presumably, this was an oversight when adding parenthesized aggregate initialization.

History
Date User Action Args
2023-12-19 10:15:28adminsetstatus: dr -> drwp
2023-07-16 13:00:43adminsetstatus: ready -> dr
2023-04-28 19:41:23adminsetmessages: + msg7258
2023-04-28 19:41:23adminsetstatus: open -> ready
2023-03-14 00:00:00admincreate