Title
void{}
Status
cd5
Section
7.6.1.4 [expr.type.conv]
Submitter
Peter Dimov

Created on 2017-06-26.00:00:00 last changed 7 months ago

Messages

Date: 2018-04-11.00:00:00

Proposed resolution, April, 2018:

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

...Otherwise, if the type is cv void and the initializer is () or {}, the expression is a prvalue of the specified type that performs no initialization. Otherwise...
Date: 2018-06-15.00:00:00

[Accepted as a DR at the June, 2018 (Rapperswil) meeting.]

According to 7.6.1.4 [expr.type.conv] paragraph 2,

If the initializer is a parenthesized single expression, the type conversion expression is equivalent to the corresponding cast expression (7.6.3 [expr.cast]). Otherwise, if the type is cv void and the initializer is () , the expression is a prvalue of the specified type that performs no initialization. Otherwise, the expression is a prvalue of the specified type whose result object is direct-initialized (9.4 [dcl.init]) with the initializer. For an expression of the form T(), T shall not be an array type.

It seems an oversight that void{} is not treated like void().

History
Date User Action Args
2020-12-15 00:00:00adminsetstatus: tentatively ready -> cd5
2018-04-11 00:00:00adminsetmessages: + msg6182
2018-04-11 00:00:00adminsetstatus: open -> tentatively ready
2017-06-26 00:00:00admincreate