Title
Pointer conversions in constant expressions
Status
c++11
Section
7.7 [expr.const]
Submitter
Jason Merrill

Created on 2010-08-01.00:00:00 last changed 123 months ago

Messages

Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

Date: 2010-11-15.00:00:00

Proposed resolution (November, 2010) [SUPERSEDED]:

Change 7.7 [expr.const] paragraph 2 as follows:

  • a type conversion from a pointer or pointer-to-member type to a literal an integral type [Note: a user-defined conversion invokes a function —end note];

[Note: the proposed resolution of issue 1188 edits this bullet in an incompatible fashion.]

Date: 2010-08-01.00:00:00

One of the bullets in 7.7 [expr.const] paragraph 2 says,

  • a type conversion from a pointer or pointer-to-member type to a literal type

This appears to prohibit conversion from one pointer type to another; for example,

    int x;
    constexpr void* p = &x;   // ill-formed

This seems excessive and probably unintentional.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3315
2011-04-10 00:00:00adminsetstatus: review -> fdis
2010-11-29 00:00:00adminsetmessages: + msg3076
2010-11-29 00:00:00adminsetstatus: open -> review
2010-08-01 00:00:00admincreate