This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


1761. Runtime check on size of automatic array

Section:  [dcl.array]     Status: NAD     Submitter: USA     Date: 2013-09-23

N3690 comment US 10

The runtime check for violating the maximum size of a stack-based array object is ill-advised. Many implementations cannot easily determine the available stack space, and checking against a fixed limit is not helpful.

Proposed resolution (September, 2013):

Change [dcl.array] paragraph 1 as follows:

...The expression is erroneous if:

...If the expression is erroneous, an exception of a type that would match a handler (14.4 [except.handle]) of type std::bad_array_length (_N3690_. [bad.array.length]) is thrown [Footnote: Implementations are encouraged also to throw such an exception if the size of the object would exceed the remaining stack space. —end footnote].

This resolution also resolves issue 1675.