This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 108i. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2022-07-16


2094. Trivial copy/move constructor for class with volatile member

Section: 11.4.5.3  [class.copy.ctor]     Status: C++17     Submitter: Daveed Vandevoorde     Date: 2015-03-06

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

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.8 [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.)

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.

Proposed resolution (June, 2016):

  1. Change 6.8 [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.8.4 [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

  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