constexpr and mutable members of literal types
6.8 [basic.types]
Richard Smith

Created on 2011-10-21.00:00:00 last changed 90 months ago


Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

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

  • ...

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

    • a glvalue of integral or enumeration type that refers to a non-volatile const object with a preceding initialization, initialized with a constant expression, or

    • a glvalue of literal type that refers to a non-volatile object defined with constexpr, or that refers to a non-mutable sub-object of such an object, or

    • a glvalue of literal type that refers to a non-volatile temporary object whose lifetime has not ended, initialized with a constant expression;

  • ...

Date: 2011-10-21.00:00:00

Currently, literal class types can have mutable members. It is not clear whether that poses any particular problems with constexpr objects and constant expressions, and if so, what should be done about it.

Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetstatus: ready -> dr
2012-11-03 00:00:00adminsetstatus: review -> ready
2012-02-27 00:00:00adminsetmessages: + msg3747
2012-02-27 00:00:00adminsetmessages: + msg3746
2012-02-27 00:00:00adminsetstatus: open -> review
2011-10-21 00:00:00admincreate