[PATCH] fix std::variant::swap for trivially-move-assignable types

Jonathan Wakely jwakely@redhat.com
Tue Aug 7 14:24:00 GMT 2018


This patch fixes the bug, but is it correct?

IIUC the _M_destructive_move effects don't depend on whether move
assignment is trivial, so should be defined the same way in both
specializations. It also looks like we can use it in the non-trivial
move assignment.

Should we define _M_destructive_move on _Move_ctor_base instead of
_Move_assign_base, so the duplication could be avoided?

Obviously this needs a ChangeLog entry and tests.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1090 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20180807/2fa5bce0/attachment.bin>


More information about the Libstdc++ mailing list