gcc/libstdc++-v3/testsuite/23_containers/list
Jonathan Wakely 47519a5687 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.

From-SVN: r277113
2019-10-17 15:21:27 +01:00
..
allocator Move from state of allocators (LWG2593) 2019-05-17 04:55:37 +00:00
capacity Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
cons Update copyright years. 2019-01-01 13:31:55 +01:00
debug Update copyright years. 2019-01-01 13:31:55 +01:00
modifiers Update copyright years. 2019-01-01 13:31:55 +01:00
operations Update copyright years. 2019-01-01 13:31:55 +01:00
requirements Fix more failing tests for C++98 mode 2019-06-06 16:34:51 +01:00
types Update copyright years. 2019-01-01 13:31:55 +01:00
14340.cc Update copyright years. 2019-01-01 13:31:55 +01:00
18604.cc Update copyright years. 2019-01-01 13:31:55 +01:00
23781_neg.cc Update copyright years. 2019-01-01 13:31:55 +01:00
48101-2_neg.cc Update copyright years. 2019-01-01 13:31:55 +01:00
48101-3_neg.cc Enforce allocator::value_type consistency for containers in C++2a 2019-06-03 14:22:59 +01:00
48101_neg.cc Update copyright years. 2019-01-01 13:31:55 +01:00
58764.cc Update copyright years. 2019-01-01 13:31:55 +01:00
61347.cc Fix test failure when -fno-inline is used 2019-01-04 18:56:26 +00:00
68222_neg.cc Update copyright years. 2019-01-01 13:31:55 +01:00
92124.cc PR libstdc++/92124 fix incorrect container move assignment 2019-10-17 15:21:27 +01:00
check_construct_destroy.cc Update copyright years. 2019-01-01 13:31:55 +01:00
check_construct_destroy.h Update copyright years. 2019-01-01 13:31:55 +01:00
erasure.cc Define __cpp_lib_erase_if feature test macro 2019-01-10 13:49:31 +00:00
init-list.cc Update copyright years. 2019-01-01 13:31:55 +01:00
init-list.h Update copyright years. 2019-01-01 13:31:55 +01:00
pmr_typedefs.cc Update copyright years. 2019-01-01 13:31:55 +01:00
pmr_typedefs_debug.cc Disable tests that aren't valid in parallel mode 2019-10-01 22:02:17 +01:00
pthread1.cc Update copyright years. 2019-01-01 13:31:55 +01:00
pthread5.cc Update copyright years. 2019-01-01 13:31:55 +01:00
range_access.cc Update copyright years. 2019-01-01 13:31:55 +01:00