wg21.cmeerw.net

Title
Trivial copy/move constructor for class with volatile member

Status
c++17

Section
11.4.5.3 [class.copy.ctor]

Submitter
Daveed Vandevoorde

Created on 2015-03-06.00:00:00 last changed 103 months ago

Messages

Date: 2016-11-15.00:00:00

[Moved to DR at the November, 2016 meeting.]

Date: 2016-06-15.00:00:00

Proposed resolution (June, 2016):

  1. Change 6.9 [basic.types] paragraph 9 as follows:

  2. ...called POD types. Cv-unqualified scalar types, trivially copyable class types (Clause 11 [class]), arrays of such types, and non-volatile const-qualified cv-qualified versions of these types (6.9.6 [basic.type.qualifier]) are collectively called trivially copyable types. Scalar types...
  3. Delete bullet 12.2 of 11.4.5.3 [class.copy.ctor]:

  4. A copy/move constructor for class X is trivial if it is not user-provided, its parameter-type-list is equivalent to the parameter-type-list of an implicit declaration, and if

    • ...

    • class X has no non-static data members of volatile-qualified type, and

    • ...

  5. Delete bullet 25.2 of 11.4.5.3 [class.copy.ctor]:

  6. A copy/move assignment operator for class X is trivial if it is not user-provided, its parameter-type-list is equivalent to the parameter-type-list of an implicit declaration, and if

    • ...

    • class X has no non-static data members of volatile-qualified type, and

Date: 2016-02-15.00:00:00

Notes from the February, 2016 meeting:

CWG agreed with the suggested direction for the changes in 11.4.5.3 [class.copy.ctor]; the use of “trivial” will be dealt with separately and not as part of the resolution of this issue.

Date: 2022-02-18.07:47:23

The resolution of issue 496 included the addition of 11.4.5.3 [class.copy.ctor] paragraph 25. 2, making a class's copy/move constructor non-trivial if it has a non-static data member of volatile-qualified type. This change breaks the IA-64 ABI, so it has been requested that CWG reconsider this aspect of the resolution.

On a related note, the resolution of issue 496 also changed 6.9 [basic.types] paragraph 9, which makes volatile-qualified scalar types “trivial” but not “trivially copyable.” It is not clear why there is a distinction made here; the only actual use of “trivial type” in the Standard appears to be in the description of qsort , which should probably use “trivially copyable.” (See also issue 1746.)

History
Date User Action Args
2018-02-27 00:00:00adminsetmessages: + msg6167
2018-02-27 00:00:00adminsetstatus: dr -> c++17
2017-02-06 00:00:00adminsetmessages: + msg6091
2017-02-06 00:00:00adminsetmessages: + msg6090
2017-02-06 00:00:00adminsetstatus: open -> dr
2015-03-06 00:00:00admincreate

Read the original on wg21.cmeerw.net ↗