This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-08-12
Consider:
struct A { const int i; }; // trivially copyable, but not trivially relocatable (deleted copy-assignment) struct B { int& r; }; // trivially copyable, but not trivially relocatable (deleted copy-assignment) struct C trivially_relocatable_if_eligible { C(); C operator=(const C&) = delete; }; // trivially relocatable struct D { C m; }; // not trivially relocatable
All of A, B, D ought to be trivially relocatable, but are not per the current Working Draft, because their copy assignment operators are implicitly deleted.
Suggested resolution:
Change in 11.2 [class.prop] paragraph 2 as follows:
A class C is default-movable if
- overload resolution for direct-initializing an object of type C from an xvalue of type C selects a constructor that is a direct member of C and is neither user-provided nor explicitly deleted,
- overload resolution for assigning to an lvalue of type C from an xvalue of type C selects an assignment operator function that is a direct member of C and is neither user-provided nor explicitly deleted, and
- C has a destructor that is neither user-provided nor explicitly deleted.
Additional notes (August, 2025)
Forwarded to EWG to confirm design intent with paper issue #2408, by decision of the CWG chair.