8edb614205
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. |
||
---|---|---|
.. | ||
pb_ds | ||
algorithm | ||
aligned_buffer.h | ||
alloc_traits.h | ||
atomicity.h | ||
bitmap_allocator.h | ||
cast.h | ||
cmath | ||
codecvt_specializations.h | ||
concurrence.h | ||
debug_allocator.h | ||
enc_filebuf.h | ||
extptr_allocator.h | ||
functional | ||
iterator | ||
malloc_allocator.h | ||
memory | ||
mt_allocator.h | ||
new_allocator.h | ||
numeric | ||
numeric_traits.h | ||
pod_char_traits.h | ||
pointer.h | ||
pool_allocator.h | ||
random | ||
random.tcc | ||
rb_tree | ||
rc_string_base.h | ||
rope | ||
ropeimpl.h | ||
slist | ||
sso_string_base.h | ||
stdio_filebuf.h | ||
stdio_sync_filebuf.h | ||
string_conversions.h | ||
throw_allocator.h | ||
type_traits.h | ||
typelist.h | ||
vstring_fwd.h | ||
vstring_util.h | ||
vstring.h | ||
vstring.tcc |