Title
Semantics of defaulted move assignment operator for unions
Status
c++23
Section
11.4.6 [class.copy.assign]
Submitter
Cassio Neri

Created on 2023-01-20.00:00:00 last changed 16 months ago

Messages

Date: 2023-01-27.23:50:39

Proposed resolution (approved by CWG 2023-01-27):

Change in 11.4.6 [class.copy.assign] paragraph 13 as follows:

The implicitly-defined copy/move assignment operator for a union X copies the object representation (6.8.1 [basic.types.general]) of X. ...
Date: 2023-02-15.00:00:00

[Accepted as a DR at the February, 2023 meeting.]

Subclause 11.4.6 [class.copy.assign] paragraph 13 does not specify the semantics of a defaulted move assignment operator:

The implicitly-defined copy assignment operator for a union X copies the object representation (6.8.1 [basic.types.general]) of X. ...

In contrast, the corresponding rule for move constructors is present in 11.4.5.3 [class.copy.ctor] paragraph 15:

The implicitly-defined copy/move constructor for a union X copies the object representation (6.8.1 [basic.types.general]) of X. ...
History
Date User Action Args
2023-07-16 13:00:43adminsetstatus: open -> c++23
2023-07-16 13:00:43adminsetstatus: dr -> open
2023-02-18 18:43:04adminsetstatus: ready -> dr
2023-02-07 05:32:28adminsetstatus: tentatively ready -> ready
2023-01-27 23:50:39adminsetstatus: open -> tentatively ready
2023-01-21 13:13:26adminsetmessages: + msg7149
2023-01-20 00:00:00admincreate