Title
Value-initializing non-objects
Status
cd3
Section
9.4 [dcl.init]
Submitter
Daniel Krügler

Created on 2010-07-17.00:00:00 last changed 131 months ago

Messages

Date: 2012-02-15.00:00:00

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

Date: 2011-08-15.00:00:00

Proposed resolution (August, 2011):

Change 7.6.1.4 [expr.type.conv] paragraph 2 as follows:

The expression T(), where T is a simple-type-specifier or typename-specifier for a non-array complete object type or the (possibly cv-qualified) void type, creates a prvalue of the specified type,which is value-initialized (9.4 [dcl.init] type, whose value is that produced by value-initializing (9.4 [dcl.init]) an object of type T; no initialization is done for the void() case). [Note:...
Date: 2010-07-17.00:00:00

9.4 [dcl.init] paragraph 7 only describes how to initialize objects:

To value-initialize an object of type T means:

However, 7.6.1.4 [expr.type.conv] paragraph 2 calls for value-initializing prvalues, which in the case of scalar types are not objects:

The expression T(), where T is a simple-type-specifier or typename-specifier for a non-array complete object type or the (possibly cv-qualified) void type, creates a prvalue of the specified type, which is value-initialized (9.4 [dcl.init]; no initialization is done for the void() case).
History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2012-11-03 00:00:00adminsetstatus: dr -> drwp
2012-02-27 00:00:00adminsetmessages: + msg3814
2012-02-27 00:00:00adminsetstatus: ready -> dr
2011-09-06 00:00:00adminsetmessages: + msg3466
2011-09-06 00:00:00adminsetstatus: open -> ready
2010-07-17 00:00:00admincreate