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++/107850] [12 Regression] std::erase_if (map) forces predicate to takes a const value_type Date: Thu, 27 Apr 2023 17:38:02 +0000 [thread overview] Message-ID: <bug-107850-4-qE29Q3NDMl@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107850-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107850 --- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:ee5ab84e5f15b6d7c488bc371e4fb0304543844f commit r12-9489-gee5ab84e5f15b6d7c488bc371e4fb0304543844f Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Nov 24 21:09:03 2022 +0000 libstdc++: Call predicate with non-const values in std::erase_if [PR107850] As specified in the standard, the predicate for std::erase_if has to be invocable as non-const with a non-const lvalues argument. Restore support for predicates that only accept non-const arguments. It's not strictly nevessary to change it for the set and unordered_set overloads, because they only give const access to the elements anyway. I've done it for them too just to keep them all consistent. libstdc++-v3/ChangeLog: PR libstdc++/107850 * include/bits/erase_if.h (__erase_nodes_if): Use non-const reference to the container. * include/experimental/map (erase_if): Likewise. * include/experimental/set (erase_if): Likewise. * include/experimental/unordered_map (erase_if): Likewise. * include/experimental/unordered_set (erase_if): Likewise. * include/std/map (erase_if): Likewise. * include/std/set (erase_if): Likewise. * include/std/unordered_map (erase_if): Likewise. * include/std/unordered_set (erase_if): Likewise. * testsuite/23_containers/map/erasure.cc: Check with const-incorrect predicate. * testsuite/23_containers/set/erasure.cc: Likewise. * testsuite/23_containers/unordered_map/erasure.cc: Likewise. * testsuite/23_containers/unordered_set/erasure.cc: Likewise. * testsuite/experimental/map/erasure.cc: Likewise. * testsuite/experimental/set/erasure.cc: Likewise. * testsuite/experimental/unordered_map/erasure.cc: Likewise. * testsuite/experimental/unordered_set/erasure.cc: Likewise. (cherry picked from commit f54ceb2062c7fef294f85ae093914fa6c7ca35b8)
next prev parent reply other threads:[~2023-04-27 17:38 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-23 21:34 [Bug c++/107850] New: " chgros at synopsys dot com 2022-11-23 22:08 ` [Bug libstdc++/107850] [12/13 Regression] " pinskia at gcc dot gnu.org 2022-11-24 8:18 ` redi at gcc dot gnu.org 2022-11-24 21:22 ` redi at gcc dot gnu.org 2022-11-25 15:07 ` cvs-commit at gcc dot gnu.org 2022-11-28 23:42 ` [Bug libstdc++/107850] [12 " chgros at synopsys dot com 2022-11-29 11:06 ` redi at gcc dot gnu.org 2022-11-29 11:20 ` redi at gcc dot gnu.org 2022-11-29 11:30 ` redi at gcc dot gnu.org 2022-11-29 16:22 ` chgros at synopsys dot com 2022-11-29 16:43 ` redi at gcc dot gnu.org 2022-11-29 18:48 ` chgros at synopsys dot com 2023-04-27 17:38 ` cvs-commit at gcc dot gnu.org [this message] 2023-04-27 17:38 ` redi 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-107850-4-qE29Q3NDMl@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: linkBe 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).