mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-17 18:04:43 +08:00
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. |
||
---|---|---|
.. | ||
1.cc | ||
2.cc | ||
3.cc | ||
4.cc | ||
5.cc | ||
6.cc | ||
7.cc | ||
36832.cc | ||
40299.cc | ||
44708.cc | ||
44963.cc | ||
61946.cc | ||
101542.cc | ||
pthread7-rope.cc |