This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Moved to DR at the October, 2015 meeting.]
In an example like
union U { int a; mutable int b; }; constexpr U u1 = {1}; int k = (u1.b = 2); constexpr U u2 = u1; // ok!!The initialization ofu2 is not disqualified bythe current wording of the Standard because the copy is donevia the object representation, not formally involving anlvalue-to-rvalue conversion. A restriction should be addedto 7.7 [expr.const] forbidding the evaluation of adefaulted copy/move construction/assignment on a class typethat has any variant mutable subobjects.
Proposed resolution (May, 2015):
Add the following bullet after bullet 3.1 of9.2.6 [dcl.constexpr]:
The definition of aconstexpr function shall satisfy thefollowing constraints:
it shall not be virtual (11.7.3 [class.virtual]);
for a defaulted copy/move assignment, the class of whichit is a member shall not have a mutable subobject that is avariant member;
...
Add the following bullet after bullet 4.1 of9.2.6 [dcl.constexpr]
The definition of aconstexpr constructor shallsatisfy the following constraints:
the class shall not have any virtual baseclasses;
for a defaulted copy/move constructor, the classshall not have a mutable subobject that is a variantmember;
...