Proposed resolution (approved by CWG 2022-07-15):
Change in 9.6.2 [dcl.fct.def.default] paragraph 2 as follows:
The type T1 of anAn explicitly defaulted special member functionFF1 with type T1 is allowed to differ from the corresponding special member function F2 with type T2it would have had if it werethat would have been implicitly declared, as follows:If T1 differs from T2 in
- T1 and T2 may have differing ref-qualifiers;
- if F2 has an implicit object parameter of type "reference to C", F1 may be an explicit object member function whose explicit object parameter is of type "reference to C";
- T1 and T2 may have differing exception specifications; and
- if
T2F2 has a non-object parameter of type const C&, the corresponding non-object parameter ofT1F1 may be of type C&.any othera way other than as allowed by the preceding rules, then:
- if
FF1 is an assignment operator, and the return type of T1 differs from the return type of T2 orT1F1's non-object parameter type is not a reference, the program is ill-formed;- otherwise, if
FF1 is explicitly defaulted on its first declaration, it is defined as deleted;- otherwise, the program is ill-formed.
Change in 11.4.6 [class.copy.assign] paragraph 1 as follows:
A user-declared copy assignment operator X::operator= is a non-static non-template member function of class X with exactly one non-object parameter of type X, X&, const X&, volatile X&, or const volatile X&.
Change in 11.4.6 [class.copy.assign] paragraph 3 as follows:
A user-declared move assignment operator X::operator= is a non-static non-template member function of class X with exactly one non-object parameter of type X&&, const X&&, volatile X&&, or const volatile X&&.
Change in 11.10.1 [class.compare.default] paragraph 1 as follows:
A defaulted comparison operator function (12.4.3 [over.binary]) for some class C shall be a non-template function that is
- a non-static
const non-volatilememberof C having one parameter of type const C& and either no ref-qualifier or the ref-qualifier &, oror friend of C anda friend of C havingeither has two parameters of type const C& or two parameters of type C , where the implicit object parameter (if any) is considered to be the first parameter..