You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the new-initializer is a braced-init-list present and the number of array elements for which initializers are provided (including the terminating '\0' in a string-literal ([lex.string])) exceeds the number of elements to initialize.
If the allocated type is an array, the new-initializer is a braced-init-list present but not (), and the expression is potentially-evaluated and not a core constant expression, the semantic constraints of copy-initializing a hypothetical element of the array from an empty initializer list are checked ([dcl.init.list]).
The text was updated successfully, but these errors were encountered:
Thinking about it again, I think [expr.new]/9 needs further modifications. For parenthesized aggregate initialization the elements without initializer should be value-initialized, not copy-list-initialized from an empty initializer list. This is also what needs to be checked here.
jensmaurer
changed the title
[expr.new] does not handle parenthesized aggregate initialization in array new
CWG3011 [expr.new] does not handle parenthesized aggregate initialization in array new
Mar 17, 2025
Full name of submitter (unless configured in github; will be published with the issue): Benjamin Sch.
Reference (section label): [expr.new]
Link to reflector thread (if any):
Issue description:
[expr.new] contains specific wording to handle aggregate initialization with braces for array new, e.g.
is specified to throw an exception.
However, [expr.new] doesn't seem to have any wording regarding parenthesized aggregate initialization for the analogous situations, e.g.
Suggested resolution:
Modify [expr.new]/8.4:
Modify [expr.new]/9:
The text was updated successfully, but these errors were encountered: