P2953R4 — Forbid defaulting operator=(X&&) &&
(3 items)
SG17
Current C++ permits explicitly-defaulted special members to differ from their implicitly-defaulted counterparts by adding ref-qualifiers, allowing implausible declarations like A& operator=(const A&) && = default where the left-hand operand is rvalue-ref-qualified. This paper proposes forbidding such declarations for explicitly defaulted copy/move assignment operators, presenting two approaches: a preferred 'ambitious' approach that makes the problematic declarations ill-formed, and a conservative alternative that makes them defaulted-as-deleted. The proposal also addresses related arcane signatures such as cv-qualified assignment operators and move assignment operators with cv-qualified non-object parameters.
- §2 "Motivation and proposal", second code block (struct D) — Parameter type is const C& but should be const D& — with const C& this is not a copy assignment operator of D and cannot be a defaulted special member function, contradicting the comment "C++26: Well-formed" and the surrounding prose. [2] [1]
- §2.3 "Existing corner cases", vendor-divergence table, 6th row — decltype expression has three opening parentheses but only two closing — the parameter-list parenthesis is never closed, producing a syntax error. Should be C& operator=(decltype(f())) = default; with three closing parentheses. [3] [2]
- §4 "Straw poll results" — Paper number P2592R1 is a transposition error (digits 5 and 9 swapped); P2592 is an unrelated paper. The parenthetical gloss correctly says P2952, confirming the intended number is P2952R1. [1] [3]
References — Anthropic Citations API
[1]
"Arthur O'Dwyer presented P2592R1 (not P2953, but P2952) in the EWG telecon of 2025-01-08."
"Arthur O'Dwyer presented P2592R1 (not P2953, but P2952) in the EWG telecon of 2025-01-08."
[2]
chars 3191–3581
"``` struct C { C& operator=(const C&) && = default; // C++26: Well-formed // Proposed: Unusable (deleted or ill-formed) }; struct D { D& operator=(this D&& self, const C&) = default; // C++26:..."
"``` struct C { C& operator=(const C&) && = default; // C++26: Well-formed // Proposed: Unusable (deleted or ill-formed) }; struct D { D& operator=(this D&& self, const C&) = default; // C++26:..."
[3]
chars 7638–8718
"URL Code Clang GCC MSVC EDG Correct Proposed(conservative) Proposed(preferred) link ``` C& operator=(C&) = default; ``` ✓ ✓ ✓ ✓ ✓ ✓ ✓ link ``` C& operator=(const C&&) =..."
"URL Code Clang GCC MSVC EDG Correct Proposed(conservative) Proposed(preferred) link ``` C& operator=(C&) = default; ``` ✓ ✓ ✓ ✓ ✓ ✓ ✓ link ``` C& operator=(const C&&) =..."
Summary: P2953R4 proposes making defaulted assignment operators with ref-qualified object parameters (e.g., operator=(X&&) &&) ill-formed or deleted, on the grounds that such defaulted operators are unusable. It provides wording changes to [class.copy.assign] and [dcl.fct.def.default] to implement this restriction.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.