Title
Triviality of copy constructor with less-qualified parameter
Status
cd4
Section
11.4.5.3 [class.copy.ctor]
Submitter
Jason Merrill

Created on 2015-09-14.00:00:00 last changed 94 months ago

Messages

Date: 2016-04-15.00:00:00

Proposed resolution (April, 2016):

  1. Change 11.4.5.3 [class.copy.ctor] paragraph 12 as follows:

  2. 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...
  3. Change 11.4.5.3 [class.copy.ctor] paragraph 25 as follows:

  4. 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...
Date: 2016-06-15.00:00:00

[Adopted at the June, 2016 meeting.]

Issue 1333 says that a defaulted copy constructor with a less-const-qualified parameter type than the implicit declaration is non-trivial. This is inconsistent with the usual pattern that whether a special member function is callable is separate from whether it is trivial; the different declaration only affects whether you can call it with a const argument, it doesn't affect the operations involved. Should this outcome be reconsidered?

History
Date User Action Args
2017-02-06 00:00:00adminsetmessages: + msg6104
2017-02-06 00:00:00adminsetstatus: drafting -> cd4
2015-09-14 00:00:00admincreate