http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57049



--- Comment #1 from Tudor Bosman <tudorb at fb dot com> 2013-04-23 15:54:18 UTC 
---

Actually, I'll take this back.  I don't believe this is a bug.



17.6.4.9 constraints arguments passed to STL functions.  So if there is a

library function that takes a rvalue argument (such as

string::operator=(string&& other)), then the library is free to assume that the

argument doesn't alias (so &other != this).  So the assertion in basic_fbstring

is correct.



The default implementation of swap() does self-move assignment.  That would be

illegal if the types were MoveAssignable STL types (because then they'd call

T::operator=(T&&) which would be illegal according to 17.6.4.9) BUT ALL STL

TYPES HAVE SPECIALIZED IMPLEMENTATIONS OF SWAP which don't do self move

assignment.



So the default swap() will do self-move-assignment on user types, but there's

no language in the standard that bans self-move-assignment there.

Reply via email to