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

2022-08-19


1331. const mismatch with defaulted copy constructor

Section: 9.5.2  [dcl.fct.def.default]     Status: CD5     Submitter: Daniel Krügler     Date: 2011-06-15

[Adopted at the November, 2017 meeting as part of paper P0641R2.]

The current requirements of 9.5.2 [dcl.fct.def.default] paragraph 1 state that a defaulted copy constructor or copy assignment operator can have a reference to const parameter only if all its subobjects have corresponding functions with a reference to const parameter, even if that function is never called. This prevents some useful template classes.

(See also library issue 2068.)

See also issue 1426.

Rationale (August, 2011):

Possible resolutions to this issue need to be considered in a wider context, so it is more appropriate for the Evolution Working Group.