https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to ensadc from comment #7)
> (In reply to Zhihao Yuan from comment #6)
> 
> I think this is a different bug. GCC thinks the implicitly-deleted move
> assignment operator `pair<int&>& pair<int&>::operator=(pair<int&>&&)` is a
> candidate for the assignment, which causes ambiguity with
> `operator=(value_type&&)` (where value_type = pair<int>). But as part of
> resolution of CWG 1402, [class.copy.assign] specifies that "A defaulted move
> assignment operator that is defined as deleted is ignored by overload
> resolution".

Incidentally, no: GCC mentions it, but considers it worse than any other
candidate.  The real ambiguity is with
operator=(const pair<int&>&), the implicitly-deleted *copy* assignment.  I
don't think this is a bug; if you disagree, please open another PR for it.

Reply via email to