From: Tomasz KamiƄski Date: Thu, 4 Dec 2025 10:25:37 +0000 (+0100) Subject: libstdc++: Fix node-base containers copy and move constructor in debug mode. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83884812c5b8ed2ec70738e6d33f6e256ae1914d;p=thirdparty%2Fgcc.git libstdc++: Fix node-base containers copy and move constructor in debug mode. The fixes regression from r16-5845-g8a2e6590cc4a2f that added an move assignment operator to the _Safe_node_sequence, and made the class both non move and copy constructible (copy is deleted, move is not declared). In consequence debug version of node containers, that define they copy and move as defaulted, and inherit from above, have deleted copy and moves. libstdc++-v3/ChangeLog: * include/debug/safe_sequence.h (_Safe_node_sequence::_Safe_node_sequence): Define as defaulted. --- diff --git a/libstdc++-v3/include/debug/safe_sequence.h b/libstdc++-v3/include/debug/safe_sequence.h index c908d1e47a9..9120044052a 100644 --- a/libstdc++-v3/include/debug/safe_sequence.h +++ b/libstdc++-v3/include/debug/safe_sequence.h @@ -136,14 +136,11 @@ namespace __gnu_debug : public _Safe_sequence<_Sequence> { public: - _GLIBCXX20_CONSTEXPR _Safe_node_sequence& - operator=(const _Safe_node_sequence&) _GLIBCXX_NOEXCEPT - { - _M_invalidate_all(); - return *this; - } - #if __cplusplus >= 201103L + _Safe_node_sequence() = default; + _Safe_node_sequence(_Safe_node_sequence&&) = default; + _Safe_node_sequence(_Safe_node_sequence const&) = default; + _GLIBCXX20_CONSTEXPR _Safe_node_sequence& operator=(_Safe_node_sequence&& __x) noexcept { @@ -153,6 +150,13 @@ namespace __gnu_debug } #endif + _GLIBCXX20_CONSTEXPR _Safe_node_sequence& + operator=(const _Safe_node_sequence&) _GLIBCXX_NOEXCEPT + { + _M_invalidate_all(); + return *this; + } + protected: _GLIBCXX20_CONSTEXPR void _M_invalidate_all() const