[Bug c++/124982] a deleted move assignment operator doesn't necessarily make a type non-move-assignable

aoliva at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 22 20:05:58 GMT 2026


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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|ASSIGNED                    |RESOLVED

--- Comment #13 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
And before I made even more of a fool of myself, I read the links you posted
while I wrote my previous comment, found them both to deviate from my theory,
so I went back to the standard and found out that I'd missed the word
"defaulted" in the sentence "A defaulted move special member function
(11.4.5.3, 11.4.6) that is defined as deleted is excluded from the set of
candidate functions in all contexts."

That's almost unfortunate.  The picture that was forming in my mind, in which
std::move never guaranteed move semantics (correct) and we'd ignore even
explicitly deleted move ctors and assignment operators in top-level types
(incorrect), just as we do for data members, base classes, containers, etc
(correct) was making a lot of sense.  It made the notion of move-assignable
equivalent to assignable, without the current special case that is one wrapper
away from being equivalent.  But I suppose that special case is still useful
for some circumstances.  Oh well...  Thanks for pointing me in the right
direction!


More information about the Gcc-bugs mailing list