public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/103501] associative containers left invalid after allocator-extended move construction
Date: Wed, 01 Dec 2021 15:08:07 +0000	[thread overview]
Message-ID: <bug-103501-4-ChKlLOq91j@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103501-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103501

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:056551414a328b427c4bf4955b9a3832f344685c

commit r12-5693-g056551414a328b427c4bf4955b9a3832f344685c
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Nov 30 23:32:50 2021 +0000

    libstdc++: Clear RB tree after moving elements [PR103501]

    If the allocator-extended move constructor move-constructs each element
    into the new container, the contents of the old container are left in
    moved-from states. We cannot know if those states preserve the
    container's ordering and uniqueness guarantees, so just erase all
    moved-from elements.

    libstdc++-v3/ChangeLog:

            PR libstdc++/103501
            * include/bits/stl_tree.h (_Rb_tree(_Rb_tree&&, false_type)):
            Clear container if elements have been moved-from.
            * testsuite/23_containers/map/allocator/move_cons.cc: Expect
            moved-from container to be empty.
            * testsuite/23_containers/multimap/allocator/move_cons.cc:
            Likewise.
            * testsuite/23_containers/multiset/allocator/103501.cc: New test.
            * testsuite/23_containers/set/allocator/103501.cc: New test.

  parent reply	other threads:[~2021-12-01 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 16:45 [Bug libstdc++/103501] New: " redi at gcc dot gnu.org
2021-11-30 22:19 ` [Bug libstdc++/103501] " redi at gcc dot gnu.org
2021-12-01 15:08 ` cvs-commit at gcc dot gnu.org [this message]
2021-12-01 17:48 ` redi at gcc dot gnu.org
2022-01-05 22:06 ` cvs-commit at gcc dot gnu.org
2022-06-15  8:14 ` cvs-commit at gcc dot gnu.org
2022-06-15  8:21 ` redi at gcc dot gnu.org
2022-06-28 10:47 ` jakub at gcc dot gnu.org
2022-06-28 12:00 ` redi at gcc dot gnu.org
2023-07-07  9:47 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103501-4-ChKlLOq91j@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).