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

2024-12-06


178. More on value-initialization

Section: 9.4  [dcl.init]     Status: TC1     Submitter: Andrew Koenig     Date: 25 Oct 1999

When the Committee considered issue 35, another context in which value initialization might be relevant was overlooked: mem-initializers. It would seem reasonable that if T() as an expression invokes value initialization, that the same syntactic construct in a mem-initializer-list would do the same, and the usefulness of value initialization in that context is at least as great as the standalone case.

Proposed resolution (10/00):

[Note: this resolution supersedes the resolution to issue 35.]

In 7.6.1.4 [expr.type.conv] paragraph 2, replace "whose value is determined by default-initialization" by "which is value-initialized".

In 7.6.2.8 [expr.new] paragraph 15,

Replace 9.4 [dcl.init] paragraph 5 by:

To zero-initialize an object of type T means:

To default-initialize an object of type T means:

To value-initialize an object of type T means:

A program that calls for default-initialization of an entity of reference type is ill-formed. If T is a cv-qualified type, the cv-unqualified version of T is used for these definitions of zero-initialization, default-initialization, and value-initialization.

In 9.4 [dcl.init] paragraph 6, change "The memory occupied by any" to "Every".

In 9.4 [dcl.init] paragraph 7, replace "default-initialized" by "value-initialized".

In 9.4.2 [dcl.init.aggr] paragraph 7, replace "default-initialized" by "value-initialized".

In 11.4.8.2 [class.conv.ctor] paragraph 2, insert "or value-initialization" after the first occurrence of "default-initialization".

In 11.9 [class.init] paragraph 1, replace the note by "The object is default-initialized if there is no initializer, or value-initialized if the initializer is ()" [i.e., replace the non-normative note by different, normative text].

In 11.9.2 [class.expl.init] paragraph 2, replace "default-initialized" by "value-initialized".

In 11.9.3 [class.base.init] paragraph 3, replace "default-initialized" by "value-initialized" in the first bulleted item.

In 11.9.3 [class.base.init] paragraph 4, replace "default-initialized, nor initialized" by "default-initialized, nor value-initialized, nor assigned".