This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-03-08


2991. "array size" is vague

Section: 9.4.1  [dcl.init.general]     Status: open     Submitter: Jonathan Wakely     Date: 2025-01-16

In 9.4.1 [dcl.init.general] bullet 16.5, the specification talks about "array size", but it is unclear whether that is the number of array elements or the size (in bytes) of the array.

Possible resolution:

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 number of elements of the array size after this potential adjustment. If k is greater than n, the program is ill-formed. Otherwise, ...