Title
Simulated reinterpret_cast in constant expressions
Status
cd3
Section
7.7 [expr.const]
Submitter
Nikolay Ivchenkov

Created on 2011-05-06.00:00:00 last changed 123 months ago

Messages

Date: 2012-10-15.00:00:00

[Moved to DR at the October, 2012 meeting.]

Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

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

  • ...

  • an id-expression that refers to a variable or data member of reference type unless...

  • a conversion from type cv void * to a pointer-to-object type;

  • a dynamic cast (7.6.1.7 [expr.dynamic.cast]);

  • ...

Date: 2022-11-20.07:54:16

Note, January, 2012:

Additional discussion has occurred, so this issue has been returned to "review" status to allow further consideration.

Date: 2011-08-15.00:00:00

Proposed resolution (August, 2011):

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

  • an lvalue-to-rvalue conversion (7.3.2 [conv.lval]) unless it is applied to...

  • an lvalue-to-rvalue conversion (7.3.2 [conv.lval]) that is applied to a glvalue of type cv1 T that refers to an object of type cv2 U, where T and U are neither the same type nor similar types (7.3.6 [conv.qual]);

  • an lvalue-to-rvalue conversion (7.3.2 [conv.lval]) that is applied to a glvalue that refers to a non-active member...

Date: 2012-09-24.00:00:00

Although a reinterpret_cast is prohibited in a constant expression, casting to and from void* can achieve the same effect.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: + msg4137
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-09-24 00:00:00adminsetmessages: + msg3870
2012-02-27 00:00:00adminsetmessages: + msg3708
2012-02-27 00:00:00adminsetstatus: review -> ready
2012-01-17 00:00:00adminsetmessages: + msg3601
2012-01-17 00:00:00adminsetstatus: ready -> review
2011-05-06 00:00:00admincreate