Created on 2023-11-06.00:00:00 last changed 5 months ago
Proposed resolution (approved by CWG 2023-11-07):
Change in 9.4.1 [dcl.init.general] bullet 16.5 as follows:
Otherwise, if the destination type is an array, the object is initialized as follows. The initializer shall be of the form ( expression-list ). Let x1 , . . . , xk be the elements of the expression-list. If the destination type is an array of unknown bound, it is defined as having k elements. Let n denote the array size after this potential adjustment. If k is greater than n, the program is ill-formed. Otherwise, ...
[Accepted as a DR at the March, 2024 meeting.]
Consider:
std::string arr[] = "some string";
Prior to the application of paper P0960R3 (Allow initializing aggregates from a parenthesized list of values), this was ill-formed, but now it is well-formed. However, the specification talks about an expression-list as part of the initializer, which does not exist in this case.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-07-20 13:52:34 | admin | set | status: dr -> drwp |
2024-04-05 21:43:46 | admin | set | status: ready -> dr |
2024-03-20 14:10:31 | admin | set | status: tentatively ready -> ready |
2023-12-02 15:54:05 | admin | set | status: review -> tentatively ready |
2023-11-08 05:03:56 | admin | set | messages: + msg7499 |
2023-11-08 05:03:56 | admin | set | status: open -> review |
2023-11-06 00:00:00 | admin | create |