https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89610
--- Comment #2 from Casey Carter <Casey at Carter dot net> --- This isn't a "missed-optimization", it's non-conforming behavior. The Allocator-aware container requirements (http://eel.is/c++draft/container.requirements.general#16.sentence-41) require only that the element type is Cpp17MoveAssignable and Cpp17MoveInsertable into the container type, so copies - even if the syntax is valid - cannot achieve the required postcondition that the target of the move assignment is equal to the value the source of the move assignment had before moving.