aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-array-bounds.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-12-15 09:52:48 +0000
committerJonathan Wakely <jwakely@redhat.com>2022-12-16 12:59:08 +0000
commit92eb0adc14a5f84acce7e5bc780b81b1544b24aa (patch)
treec306b29be2c436f34a1dfffa48e0d909d2cab204 /gcc/gimple-array-bounds.cc
parentd386d399205e68e02b357dfcd96b9a4b91e4f295 (diff)
downloadgcc-92eb0adc14a5f84acce7e5bc780b81b1544b24aa.zip
gcc-92eb0adc14a5f84acce7e5bc780b81b1544b24aa.tar.gz
gcc-92eb0adc14a5f84acce7e5bc780b81b1544b24aa.tar.bz2
libstdc++: Fix self-move for std::weak_ptr [PR108118]
I think an alternative fix would be something like: _M_ptr = std::exchange(rhs._M_ptr, nullptr); _M_refcount = std::move(rhs._M_refcount); The standard's move-and-swap implementation generates smaller code at all levels except -O0 and -Og, so it seems simplest to just do what the standard says. libstdc++-v3/ChangeLog: PR libstdc++/108118 * include/bits/shared_ptr_base.h (weak_ptr::operator=): Implement as move-and-swap exactly as specified in the standard. * testsuite/20_util/weak_ptr/cons/self_move.cc: New test.
Diffstat (limited to 'gcc/gimple-array-bounds.cc')
0 files changed, 0 insertions, 0 deletions