]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix debug mode for unordered containers.
authorTomasz Kamiński <tkaminsk@redhat.com>
Thu, 4 Dec 2025 14:28:00 +0000 (15:28 +0100)
committerTomasz Kamiński <tkaminsk@redhat.com>
Thu, 4 Dec 2025 15:14:20 +0000 (16:14 +0100)
The r16-5845-g8a2e6590cc4a2f changed the _Safe_container copy-assignment
to delegate to assignment of the _Base. However, _Safe_unordered_container_base
was not updated, and due the presence of move constructor, it's assignments are
deleted, causing hard error for assignment of any unordered container.

libstdc++-v3/ChangeLog:

* include/debug/safe_unordered_base.h
(_Safe_unordered_container_base::operator=): Define as
defaulted, inherit behavior of _Safe_sequence_base.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
libstdc++-v3/include/debug/safe_unordered_base.h

index 55cf581e315e3ca4ba920ddc0d243dac6295f622..c7b98a53e74329213c5d7435fb9d90745701825e 100644 (file)
@@ -162,6 +162,12 @@ namespace __gnu_debug
     : _Safe_unordered_container_base()
     { this->_M_swap(__x); }
 
+    _Safe_unordered_container_base&
+    operator=(_Safe_unordered_container_base const&) = default;
+    
+    _Safe_unordered_container_base&
+    operator=(_Safe_unordered_container_base&&) = default;
+
     /** Notify all iterators that reference this container that the
        container is being destroyed. */
     ~_Safe_unordered_container_base() noexcept