]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Adjust flat_set::swap swapping order
authorPatrick Palka <ppalka@redhat.com>
Fri, 29 May 2026 19:21:06 +0000 (15:21 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 29 May 2026 19:21:06 +0000 (15:21 -0400)
In r17-908 I accidentally made us swap the comparator first, but we
decided that the container should be swapped first.

libstdc++-v3/ChangeLog:

* include/std/flat_set (_Flat_set_impl::swap): Swap _M_cont
first.

libstdc++-v3/include/std/flat_set

index 2f204cc08bf99deffe4fea34ce3337534d932fe0..31dce48bbe0ad937ad2baf26350539e6c5f14ce8 100644 (file)
@@ -680,8 +680,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        auto __guard = _M_make_clear_guard();
        auto __guard_y = _ClearGuard{__y._M_cont};
-       ranges::swap(_M_comp, __y._M_comp);
        ranges::swap(_M_cont, __y._M_cont);
+       ranges::swap(_M_comp, __y._M_comp);
        __guard._M_disable();
        __guard_y._M_disable();
       }