Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2226657/?format=api
{ "id": 2226657, "url": "http://patchwork.ozlabs.org/api/patches/2226657/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhunsl25ss.gcc.gcc-TEST.redi.39.1.1@forge-stage.sourceware.org/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<bmm.hhunsl25ss.gcc.gcc-TEST.redi.39.1.1@forge-stage.sourceware.org>", "list_archive_url": null, "date": "2026-04-22T18:00:49", "name": "[v1,1/1] libstdc++: Make std::erase for linked lists convert to bool", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "209ad7298f6630b8e17eae8162e3be1f7a087ae6", "submitter": { "id": 93210, "url": "http://patchwork.ozlabs.org/api/people/93210/?format=api", "name": "Jonathan Wakely via Sourceware Forge", "email": "forge-bot+redi@forge-stage.sourceware.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhunsl25ss.gcc.gcc-TEST.redi.39.1.1@forge-stage.sourceware.org/mbox/", "series": [ { "id": 501060, "url": "http://patchwork.ozlabs.org/api/series/501060/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501060", "date": "2026-04-22T18:00:48", "name": "libstdc++: Make std::erase for linked lists convert to bool", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501060/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2226657/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2226657/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org", "sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g16ch4kl8z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 04:07:00 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id CECED4BAE7F5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:06:58 +0000 (GMT)", "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 4412A4B92082\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:02:23 +0000 (GMT)", "from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 79680433A6\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:02:03 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org CECED4BAE7F5", "OpenDKIM Filter v2.11.0 sourceware.org 4412A4B92082" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 4412A4B92082", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 4412A4B92082", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776880943; cv=none;\n b=SLM5t8R8vtQya1XWiiLFT1VOOPUhE8dVscsLJzr/14Cjtk1WONjC43DjKx84SiHBThdtzVCnzWJm2DOrZvYl4cEgV3guAtiKHI/ZONOuNaT2l1Co0ONvpw0ZupGCB6AYlz7yx3al+AbTqd4OmrQa7aOO0Byl3zUyPm32bs9WSoc=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776880943; c=relaxed/simple;\n bh=xb0Z3IFc7Oz6Coib3ndCorF8EVFj0iH6WF851e8sEt8=;\n h=From:Date:Subject:MIME-Version:To:Message-ID;\n b=YSLiRb8NjE0tx/gOV/goxFpICvmKTvw7YVP7/J0zEgmJOy3l7Fb0vGXg9ZlTXH7qbemb46vi4OL3PyZkrnE2CNvpLiNfkfRJ2gXZnX2SOIr5ir861J3+Z7nfSnmxVk9DUARL5iaZBQMN7dMjdMNIyN7rhHiQ8jKe8YyAKLaNZ9Q=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "From": "Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>", "Date": "Wed, 22 Apr 2026 18:00:49 +0000", "Subject": "[PATCH v1 1/1] libstdc++: Make std::erase for linked lists convert to\n bool", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>", "Message-ID": "\n <bmm.hhunsl25ss.gcc.gcc-TEST.redi.39.1.1@forge-stage.sourceware.org>", "X-Mailer": "batrachomyomachia", "X-Pull-Request-Organization": "gcc", "X-Pull-Request-Repository": "gcc-TEST", "X-Pull-Request": "https://forge.sourceware.org/gcc/gcc-TEST/pulls/39", "References": "\n <bmm.hhunsl25ss.gcc.gcc-TEST.redi.39.1.0@forge-stage.sourceware.org>", "In-Reply-To": "\n <bmm.hhunsl25ss.gcc.gcc-TEST.redi.39.1.0@forge-stage.sourceware.org>", "X-Patch-URL": "\n https://forge.sourceware.org/redi/gcc/commit/61fe7df8574fba75a9e3b4f79eb78ffed5e64a7c", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Reply-To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>, redi@gcc.gnu.org", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "From: Jonathan Wakely <jwakely@redhat.com>\n\nLWG 4135 (approved in Wrocław, November 2024) fixes the lambda\nexpressions used by std::erase for std::list and std::forward_list.\nPreviously they attempted to copy something that isn't required to be\ncopyable. Instead they should convert it to bool right away.\n\nThe issue resolution also changes the lambda's parameter to be const, so\nthat it can't modify the elements while comparing them.\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/std/forward_list (erase): Change lambda to have\n\texplicit return type and const parameter type.\n\t* include/std/list (erase): Likewise.\n\t* testsuite/23_containers/forward_list/erasure.cc: Check lambda\n\tis correct.\n\t* testsuite/23_containers/list/erasure.cc: Likewise.\n---\n libstdc++-v3/include/std/forward_list | 5 +++--\n libstdc++-v3/include/std/list | 5 +++--\n .../23_containers/forward_list/erasure.cc | 22 +++++++++++++++++++\n .../testsuite/23_containers/list/erasure.cc | 22 +++++++++++++++++++\n 4 files changed, 50 insertions(+), 4 deletions(-)", "diff": "diff --git a/libstdc++-v3/include/std/forward_list b/libstdc++-v3/include/std/forward_list\nindex 6c5ad1195db9..166fdb04242a 100644\n--- a/libstdc++-v3/include/std/forward_list\n+++ b/libstdc++-v3/include/std/forward_list\n@@ -83,8 +83,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n inline typename forward_list<_Tp, _Alloc>::size_type\n erase(forward_list<_Tp, _Alloc>& __cont, const _Up& __value)\n {\n- using __elem_type = typename forward_list<_Tp, _Alloc>::value_type;\n- return std::erase_if(__cont, [&](__elem_type& __elem) {\n+ // _GLIBCXX_RESOLVE_LIB_DEFECTS\n+ // 4135. helper lambda of std::erase for list should specify return type\n+ return std::erase_if(__cont, [&](const auto& __elem) -> bool {\n \t return __elem == __value;\n });\n }\ndiff --git a/libstdc++-v3/include/std/list b/libstdc++-v3/include/std/list\nindex 51f1bc079cc2..170499d65f71 100644\n--- a/libstdc++-v3/include/std/list\n+++ b/libstdc++-v3/include/std/list\n@@ -107,8 +107,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n inline typename list<_Tp, _Alloc>::size_type\n erase(list<_Tp, _Alloc>& __cont, const _Up& __value)\n {\n- using __elem_type = typename list<_Tp, _Alloc>::value_type;\n- return std::erase_if(__cont, [&](__elem_type& __elem) {\n+ // _GLIBCXX_RESOLVE_LIB_DEFECTS\n+ // 4135. helper lambda of std::erase for list should specify return type\n+ return std::erase_if(__cont, [&](const auto& __elem) -> bool {\n \t return __elem == __value;\n });\n }\ndiff --git a/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc b/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc\nindex 37e502039599..1ec11de6e36c 100644\n--- a/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc\n+++ b/libstdc++-v3/testsuite/23_containers/forward_list/erasure.cc\n@@ -53,6 +53,28 @@ test02()\n VERIFY( num == 0 );\n }\n \n+// LWG 4135.\n+// The helper lambda of std::erase for list should specify return type as bool\n+void\n+test_lwg4135()\n+{\n+ struct Bool {\n+ Bool() = default;\n+ Bool(const Bool&) = delete;\n+ operator bool() const { return false; }\n+ };\n+\n+ static Bool b;\n+\n+ struct Int {\n+ Bool& operator==(Int) const { return b; }\n+ void operator==(Int) = delete;\n+ };\n+\n+ std::forward_list<Int> l;\n+ std::erase(l, Int{});\n+}\n+\n int\n main()\n {\ndiff --git a/libstdc++-v3/testsuite/23_containers/list/erasure.cc b/libstdc++-v3/testsuite/23_containers/list/erasure.cc\nindex 1a33eca77c26..9f4f8536fe64 100644\n--- a/libstdc++-v3/testsuite/23_containers/list/erasure.cc\n+++ b/libstdc++-v3/testsuite/23_containers/list/erasure.cc\n@@ -52,6 +52,28 @@ test02()\n VERIFY( num == 0 );\n }\n \n+// LWG 4135.\n+// The helper lambda of std::erase for list should specify return type as bool\n+void\n+test_lwg4135()\n+{\n+ struct Bool {\n+ Bool() = default;\n+ Bool(const Bool&) = delete;\n+ operator bool() const { return false; }\n+ };\n+\n+ static Bool b;\n+\n+ struct Int {\n+ Bool& operator==(Int) const { return b; }\n+ void operator==(Int) = delete;\n+ };\n+\n+ std::list<Int> l;\n+ std::erase(l, Int{});\n+}\n+\n int\n main()\n {\n", "prefixes": [ "v1", "1/1" ] }