aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-02-04 12:59:14 +0000
committerJonathan Wakely <jwakely@redhat.com>2020-02-04 13:02:37 +0000
commit9962493ca2f71d3f3dd06b0e9cd19fcf849e3e4b (patch)
tree2bcdd7d3ee397e99f0bd462b8bba0cf6e1f7d9f2 /gcc
parent59afd6ad83665ad93d3c87af238a21a9c1c38079 (diff)
downloadgcc-9962493ca2f71d3f3dd06b0e9cd19fcf849e3e4b.zip
gcc-9962493ca2f71d3f3dd06b0e9cd19fcf849e3e4b.tar.gz
gcc-9962493ca2f71d3f3dd06b0e9cd19fcf849e3e4b.tar.bz2
libstdc++: Fix regressions in unique_ptr::swap (PR 93562)
The requirements for this function are only that the deleter is swappable, but we incorrectly require that the element type is complete and that the deleter can be swapped using std::swap (which requires it to be move cosntructible and move assignable). The fix is to add __uniq_ptr_impl::swap which swaps the pointer and deleter individually, instead of using the generic std::swap on the tuple containing them. PR libstdc++/93562 * include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define. (unique_ptr::swap, unique_ptr<T[], D>::swap): Call it. * testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions