Title 2268. Unions with mutable members in constant expressions revisited
Status c++17 Section 10.1.5 [dcl.constexpr]
Submitter Richard Smith

Created on 2016-05-26.00:00:00 by admin, last changed by admin.

msg6123 (view) Date: 2017-02-15.00:00:00

Proposed resolution (February, 2017):

  1. Add the following as a new bullet following 8.20 [expr.const] bullet 2.8

  2. A conditional-expression e is a core constant expression unless the evaluation of e , following the rules of the abstract machine (4.6 [intro.execution]), would evaluate one of the following expressions:

    • ...

    • an lvalue-to-rvalue conversion (7.1 [conv.lval]) that is applied to a glvalue that refers to a non-active member of a union or a subobject thereof;

    • an invocation of an implicitly-defined copy/move constructor or copy/move assignment operator for a union whose active member (if any) is mutable, unless the lifetime of the union object began within the evaluation of e;

    • ...

  3. Delete bullet 3.2 in 10.1.5 [dcl.constexpr]:

    • for a defaulted copy/move assignment, the class of which it is a member shall not have a mutable subobject that is a variant member;

  4. Delete bullet 4.2 in 10.1.5 [dcl.constexpr]:

    • for a defaulted copy/move constructor, the class shall not have a mutable subobject that is a variant member;

msg5902 (view) Date: 2017-02-15.00:00:00

[Adopted at the February/March, 2017 meeting.]

[Detailed description pending.]

Date User Action Args
2018-02-27 00:00:00adminsetstatus: open -> c++17
section: 7.1.5 [dcl.constexpr] -> 10.1.5 [dcl.constexpr]
2018-02-27 00:00:00adminsetmessages: + msg6123
2016-05-26 00:00:00admincreate