On Thu, 4 Dec 2025 at 15:10, Tomasz Kamiński <[email protected]> wrote:
>
> The r16-5845-g8a2e6590cc4a2f changed the _Safe_container copy-assignment
> to delegate to assigment 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.
> ---
> Turned out to be simple fix, but took me some time to realize what actually
> caused the regressions.
>
> Testing on x86_64-linux (on cfarm). *unordered_* tests all passed with
> debug mode locally. OK for trunk?

OK thanks.

>
>  libstdc++-v3/include/debug/safe_unordered_base.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/libstdc++-v3/include/debug/safe_unordered_base.h 
> b/libstdc++-v3/include/debug/safe_unordered_base.h
> index 55cf581e315..c7b98a53e74 100644
> --- a/libstdc++-v3/include/debug/safe_unordered_base.h
> +++ b/libstdc++-v3/include/debug/safe_unordered_base.h
> @@ -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
> --
> 2.52.0
>

Reply via email to