Title
Explicit temporaries and integral constant expressions
Status
nad
Section
7.7 [expr.const]
Submitter
Mike Miller

Created on 2000-07-19.00:00:00 last changed 160 months ago

Messages

Date: 2011-08-15.00:00:00

Rationale (August, 2011):

As given in the preceding note.

Date: 2008-03-15.00:00:00

Note (March, 2008):

This issue should be closed as NAD as a result of the rewrite of 7.7 [expr.const] in conjunction with the constexpr proposal.

Date: 2022-11-20.07:54:16

Does an explicit temporary of an integral type qualify as an integral constant expression? For instance,

    void* p = int();    // well-formed?

It would appear to be, since int() is an explicit type conversion according to 7.6.1.4 [expr.type.conv] (at least, it's described in a section entitled "Explicit type conversion") and type conversions to integral types are permitted in integral constant expressions (7.7 [expr.const]). However, this reasoning is somewhat tenuous, and some at least have argued otherwise.

History
Date User Action Args
2011-09-06 00:00:00adminsetmessages: + msg3572
2011-09-06 00:00:00adminsetstatus: review -> nad
2008-03-17 00:00:00adminsetmessages: + msg1597
2008-03-17 00:00:00adminsetstatus: open -> review
2000-07-19 00:00:00admincreate