Title
Runtime check on size of automatic array
Status
nad
Section
9.3.4.5 [dcl.array]
Submitter
USA

Created on 2013-09-23.00:00:00 last changed 130 months ago

Messages

Date: 2013-09-15.00:00:00

Proposed resolution (September, 2013):

Change 9.3.4.5 [dcl.array] paragraph 1 as follows:

...The expression is erroneous if:

  • its value before converting...

  • its value is such that the size of the allocated object would exceed the implementation-defined limit for the maximum size of an object (Annex Clause Annex B [implimits]);

  • ...

...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_.18.6.2.2 [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.

Date: 2013-09-23.00:00:00
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.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: ready -> nad
2013-10-14 00:00:00adminsetmessages: + msg4588
2013-09-23 00:00:00admincreate