gcc/libstdc++-v3/testsuite/ext
Jonathan Wakely 8edb614205 libstdc++: Make __gnu_cxx::sequence_buffer move-aware [PR101542]
The PR explains that Clang trunk now selects a different constructor
when a non-const sequence_buffer is returned in a context where it
qualifies as an implicitly-movable entity. Because lookup is first
performed using an rvalue, the sequence_buffer(const sequence_buffer&)
constructor gets chosen, which makes a copy instead of a "pseudo-move"
via the sequence_buffer(sequence_buffer&) constructor. The problem isn't
seen with GCC because as noted in the r11-2412 commit log, GCC actually
implements a slightly modified rule that avoids breaking exactly this
type of code.

This patch adds a move constructor to sequence_buffer, so that implicit
or explicit moves will have the same effect, calling the
sequence_buffer(sequence_buffer&) constructor. A move assignment
operator is also added to make move assignment work similarly.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/101542
	* include/ext/rope (sequence_buffer): Add move constructor and
	move assignment operator.
	* testsuite/ext/rope/101542.cc: New test.
2021-07-21 17:20:37 +01:00
..
bitmap_allocator Update copyright years. 2021-01-04 10:26:59 +01:00
char8_t Fix tests that fail with -std=gnu++98 or -std=gnu++11 2019-06-06 13:13:42 +01:00
codecvt Update copyright years. 2021-01-04 10:26:59 +01:00
concurrence_lock_error Update copyright years. 2021-01-04 10:26:59 +01:00
concurrence_unlock_error Update copyright years. 2021-01-04 10:26:59 +01:00
debug_allocator Update copyright years. 2021-01-04 10:26:59 +01:00
enc_filebuf Update copyright years. 2021-01-04 10:26:59 +01:00
ext_pointer Update copyright years. 2021-01-04 10:26:59 +01:00
forced_error Update copyright years. 2021-01-04 10:26:59 +01:00
iota Update copyright years. 2021-01-04 10:26:59 +01:00
is_heap Update copyright years. 2021-01-04 10:26:59 +01:00
is_sorted Update copyright years. 2021-01-04 10:26:59 +01:00
malloc_allocator Update copyright years. 2021-01-04 10:26:59 +01:00
mt_allocator Update copyright years. 2021-01-04 10:26:59 +01:00
new_allocator Update copyright years. 2021-01-04 10:26:59 +01:00
numeric_traits Update copyright years. 2021-01-04 10:26:59 +01:00
pb_ds Update copyright years. 2021-01-04 10:26:59 +01:00
pool_allocator Update copyright years. 2021-01-04 10:26:59 +01:00
random Update copyright years. 2021-01-04 10:26:59 +01:00
rope libstdc++: Make __gnu_cxx::sequence_buffer move-aware [PR101542] 2021-07-21 17:20:37 +01:00
shared_ptr Update copyright years. 2021-01-04 10:26:59 +01:00
slist Update copyright years. 2021-01-04 10:26:59 +01:00
special_functions Update copyright years. 2021-01-04 10:26:59 +01:00
stdio_filebuf Update copyright years. 2021-01-04 10:26:59 +01:00
stdio_sync_filebuf Update copyright years. 2021-01-04 10:26:59 +01:00
throw_allocator Update copyright years. 2021-01-04 10:26:59 +01:00
throw_value Update copyright years. 2021-01-04 10:26:59 +01:00
type_traits Update copyright years. 2021-01-04 10:26:59 +01:00
vstring libstdc++: Suppress more vstring testsuite warnings. [PR 98613] 2021-01-10 18:22:51 -05:00
concept_checks.cc Update copyright years. 2021-01-04 10:26:59 +01:00
headers.cc Update copyright years. 2021-01-04 10:26:59 +01:00
median.cc Update copyright years. 2021-01-04 10:26:59 +01:00
pod_char_traits.cc Update copyright years. 2021-01-04 10:26:59 +01:00