aboutsummaryrefslogtreecommitdiff
path: root/libssp
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2019-10-17 14:21:27 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2019-10-17 14:21:27 +0000
commit58e58960884ffc5ca555580658ee860950669993 (patch)
tree3613ae6f84da1b3ebd3fbbf1e137b4286ffb4dc1 /libssp
parent47ba0e62d09b4c560a8c964971f2b7c01437bb5e (diff)
PR libstdc++/92124 fix incorrect container move assignment
The container requirements say that for move assignment "All existing elements of [the target] are either move assigned or destroyed". Some of our containers currently use __make_move_if_noexcept which makes the move depend on whether the element type is nothrow move constructible. This is incorrect, because the standard says we must move assign, not move or copy depending on the move constructor. Use make_move_iterator instead so that we move unconditionally. This ensures existing elements won't be copy assigned. PR libstdc++/92124 * include/bits/forward_list.h (_M_move_assign(forward_list&&, false_type)): Do not use __make_move_if_noexcept, instead move unconditionally. * include/bits/stl_deque.h (_M_move_assign2(deque&&, false_type)): Likewise. * include/bits/stl_list.h (_M_move_assign(list&&, false_type)): Likewise. * include/bits/stl_vector.h (_M_move_assign(vector&&, false_type)): Likewise. * testsuite/23_containers/vector/92124.cc: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277113 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libssp')
0 files changed, 0 insertions, 0 deletions