This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

2737. Consider relaxing object size restrictions for single-object allocation functions

Section: 17.6.3.2 [new.delete.single] Status: New Submitter: Clark Nelson Opened: 2016-06-21 Last modified: 2016-08-01

Priority: 3

View other active issues in [new.delete.single].

View all other issues in [new.delete.single].

View all issues with New status.

Discussion:

It should be considered whether the description of the single-object allocation functions should say "or smaller", like the array allocation functions. For example, according to 17.6.3.2 [new.delete.single] p1 (emphasis mine):

The allocation function (3.7.4.1) called by a new-expression (5.3.4) to allocate size bytes of storage suitably aligned to represent any object of that size.

In contrast to this, 17.6.3.3 [new.delete.array] p1 says (emphasis mine):

The allocation function (3.7.4.1) called by the array form of a new-expression (5.3.4) to allocate size bytes of storage suitably aligned to represent any array object of that size or smaller. (footnote: It is not the direct responsibility of operator new[](std::size_t) or operator delete[](void*) to note the repetition count or element size of the array. Those operations are performed elsewhere in the array new and delete expressions. The array new expression, may, however, increase the size argument to operator new[](std::size_t) to obtain space to store supplemental information.)

Proposed resolution: