Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195386/?format=api
{ "id": 2195386, "url": "http://patchwork.ozlabs.org/api/patches/2195386/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260210231349.1591787-1-ncm@cantrip.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": "<20260210231349.1591787-1-ncm@cantrip.org>", "list_archive_url": null, "date": "2026-02-10T23:13:37", "name": "libstdc++: debug impls for heterogeneous erasure overloads (P2077) [PR117404]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "8726ed8a61a0002612e33e061e4294226c68082c", "submitter": { "id": 90892, "url": "http://patchwork.ozlabs.org/api/people/90892/?format=api", "name": "Nathan Myers", "email": "ncm@cantrip.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260210231349.1591787-1-ncm@cantrip.org/mbox/", "series": [ { "id": 491749, "url": "http://patchwork.ozlabs.org/api/series/491749/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=491749", "date": "2026-02-10T23:13:37", "name": "libstdc++: debug impls for heterogeneous erasure overloads (P2077) [PR117404]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491749/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195386/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195386/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=38.145.34.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;\n dmarc=none (p=none dis=none) header.from=cantrip.org", "sourceware.org; spf=fail smtp.mailfrom=cantrip.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=205.139.111.44" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4f9cpD649dz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 11 Feb 2026 10:14:27 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id D44AF4BA23F4\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 23:14:23 +0000 (GMT)", "from us-smtp-delivery-44.mimecast.com\n (us-smtp-delivery-44.mimecast.com [205.139.111.44])\n by sourceware.org (Postfix) with ESMTP id C3B6B4BA2E09\n for <gcc-patches@gcc.gnu.org>; Tue, 10 Feb 2026 23:13:55 +0000 (GMT)", "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-6PaoWDNENEeUkrRYPtUo-w-1; Tue,\n 10 Feb 2026 18:13:53 -0500", "from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id A483518005BC; Tue, 10 Feb 2026 23:13:52 +0000 (UTC)", "from redhat.redhat.com (unknown [10.2.16.56])\n by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 8F4AC1800464; Tue, 10 Feb 2026 23:13:51 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org D44AF4BA23F4", "OpenDKIM Filter v2.11.0 sourceware.org C3B6B4BA2E09" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org C3B6B4BA2E09", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org C3B6B4BA2E09", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770765235; cv=none;\n b=CJ8XDT3S4YYhgN+Lnyd0+Q8yrdWDjsaEOT2X7bLFr43nDBu/e13ZD7v7TbuGJ6zBjc5/LW1iRqjxd0151tcT/GFiQOm3YmCxe0MvFcsYvsa6AfCg9/WVuJVOdsyNIolAjyPAgqWm5LuUvHRMY+CNTS3LpOH9UTCFybhMBwOFsiM=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770765235; c=relaxed/simple;\n bh=VDXOjrO3ASoLonxbSEqJ3ZJcX4/dVRivQn1OoX7LDdE=;\n h=From:To:Subject:Date:Message-ID:MIME-Version;\n b=O7SFU6FbGNfh2b3wsaOfaOBK70CdNNSrBNmCmmDww1BEQUceWWpvP/i3WVfhQ+uv7EbjYc47mgMFon0bue9tIS7oJXFTEJAtcKGOc59qR3JKpNU+B0GIDvVaCq1VNQyoPUB6QeQqAvR9kh+yS/CEHvTMgIvBEazd9pT1HiKLtn4=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "X-MC-Unique": "6PaoWDNENEeUkrRYPtUo-w-1", "X-Mimecast-MFC-AGG-ID": "6PaoWDNENEeUkrRYPtUo-w_1770765232", "From": "Nathan Myers <ncm@cantrip.org>", "To": "gcc-patches@gcc.gnu.org,\n\tlibstdc++@gcc.gnu.org", "Subject": "[PATCH] libstdc++: debug impls for heterogeneous erasure overloads\n (P2077) [PR117404]", "Date": "Tue, 10 Feb 2026 18:13:37 -0500", "Message-ID": "<20260210231349.1591787-1-ncm@cantrip.org>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.111", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "L1qLd1PF0_UFF98If6D24sHjDdij113Qzwwm4oB7RgI_1770765232", "X-Mimecast-Originator": "cantrip.org", "Content-Transfer-Encoding": "quoted-printable", "content-type": "text/plain; charset=WINDOWS-1252; x-default=true", "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>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "Implement the debug versions of new overloads from P2077.\n\nAlso, make existing unordered_set<>::erase perform the same\nbucket check as erase on unordered_multimap.\n\nlibstdc++-v3/ChangeLog:\n\tPR libstdc++/117402\n\t* include/debug/map.h (extract, erase): Define overloads.\n\t* include/debug/multimap.h: Same.\n\t* include/debug/multiset.h: Same.\n\t* include/debug/set.h: Same.\n\t* include/debug/unordered_map: Same (2x).\n\t* include/debug/unordered_set: Same (2x).\n---\n libstdc++-v3/include/debug/map.h | 30 ++++++++++++\n libstdc++-v3/include/debug/multimap.h | 27 +++++++++++\n libstdc++-v3/include/debug/multiset.h | 27 +++++++++++\n libstdc++-v3/include/debug/set.h | 30 ++++++++++++\n libstdc++-v3/include/debug/unordered_map | 49 +++++++++++++++++++\n libstdc++-v3/include/debug/unordered_set | 62 +++++++++++++++++++++---\n 6 files changed, 219 insertions(+), 6 deletions(-)", "diff": "diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h\nindex 0fc7afae385..29363a08d4d 100644\n--- a/libstdc++-v3/include/debug/map.h\n+++ b/libstdc++-v3/include/debug/map.h\n@@ -476,6 +476,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<map> _Kt>\n+\tnode_type\n+\textract(_Kt&& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != end() ? extract(__position) : {};\n+\t}\n+# endif\n+\n insert_return_type\n insert(node_type&& __nh)\n {\n@@ -538,6 +548,26 @@ namespace __debug\n \t }\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ // Note that for some types _Kt this may erase more than\n+ // one element, such as if _Kt::operator< checks only part\n+ // of the key.\n+ template <__heterogeneous_tree_key<map> _Kt>\n+\tsize_type\n+\terase(_Kt&& __x)\n+\t{\n+\t auto __victims = _Base::equal_range<_Kt>(__x);\n+\t size_type __count = 0;\n+\t for (auto __victim = __victims.first; __victim != __victims.second;)\n+\t {\n+\t this->_M_invalidate_if(_Equal(__victim));\n+\t _Base::erase(__victim++);\n+\t ++__count;\n+\t }\n+\t return __count;\n+\t}\n+# endif\n+\n #if __cplusplus >= 201103L\n iterator\n erase(const_iterator __first, const_iterator __last)\ndiff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h\nindex 4137186c527..ba6e9498710 100644\n--- a/libstdc++-v3/include/debug/multimap.h\n+++ b/libstdc++-v3/include/debug/multimap.h\n@@ -360,6 +360,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<multimap> _Kt>\n+\tnode_type\n+\textract(_Kt&& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != end() ? extract(__position) : {};\n+\t}\n+# endif\n+\n iterator\n insert(node_type&& __nh)\n { return { _Base::insert(std::move(__nh)), this }; }\n@@ -420,6 +430,23 @@ namespace __debug\n \treturn __count;\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<multimap> _Kt>\n+\tsize_type\n+\terase(_Kt&& __x)\n+\t{\n+\t auto __victims = _Base::equal_range<_Kt>(__x);\n+\t size_type __count = 0;\n+\t for (auto __victim = __victims.first; __victim != __victims.second;)\n+\t {\n+\t this->_M_invalidate_if(_Equal(__victim));\n+\t _Base::erase(__victim++);\n+\t ++__count;\n+\t }\n+\t return __count;\n+\t}\n+# endif\n+\n #if __cplusplus >= 201103L\n iterator\n erase(const_iterator __first, const_iterator __last)\ndiff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h\nindex 6fa499228f5..c8e34f704b4 100644\n--- a/libstdc++-v3/include/debug/multiset.h\n+++ b/libstdc++-v3/include/debug/multiset.h\n@@ -331,6 +331,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<multiset> _Kt>\n+\tnode_type\n+\textract(_Kt&& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != end() ? extract(__position) : {};\n+\t}\n+#endif\n+\n iterator\n insert(node_type&& __nh)\n { return { _Base::insert(std::move(__nh)), this }; }\n@@ -387,6 +397,23 @@ namespace __debug\n \treturn __count;\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<multiset> _Kt>\n+\tsize_type\n+\terase(_Kt&& __x)\n+\t{\n+\t auto __victims = _Base::equal_range<_Kt>(__x);\n+\t size_type __count = 0;\n+\t for (auto __victim = __victims.first; __victim != __victims.second;)\n+\t {\n+\t this->_M_invalidate_if(_Equal(__victim));\n+\t _Base::erase(__victim++);\n+\t ++__count;\n+\t }\n+\t return __count;\n+\t}\n+# endif\n+\n #if __cplusplus >= 201103L\n _GLIBCXX_ABI_TAG_CXX11\n iterator\ndiff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h\nindex 99701d4a6d7..9a3bcce41fa 100644\n--- a/libstdc++-v3/include/debug/set.h\n+++ b/libstdc++-v3/include/debug/set.h\n@@ -340,6 +340,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<set> _Kt>\n+\tnode_type\n+\textract(_Kt&& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != end() ? extract(__position) : {};\n+\t}\n+#endif\n+\n insert_return_type\n insert(node_type&& __nh)\n {\n@@ -398,6 +408,26 @@ namespace __debug\n \t }\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ // Note that for some types _Kt this may erase more than\n+ // one element, such as if _Kt::operator< checks only part\n+ // of the key.\n+ template <__heterogeneous_tree_key<set> _Kt>\n+\tsize_type\n+\terase(_Kt&& __x)\n+\t{\n+\t auto __victims = _Base::equal_range<_Kt>(__x);\n+\t size_type __count = 0;\n+\t for (auto __victim = __victims.first; __victim != __victims.second;)\n+\t {\n+\t this->_M_invalidate_if(_Equal(__victim));\n+\t _Base::erase(__victim++);\n+\t ++__count;\n+\t }\n+\t return __count;\n+\t}\n+#endif\n+\n #if __cplusplus >= 201103L\n _GLIBCXX_ABI_TAG_CXX11\n iterator\ndiff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map\nindex 4bde18c917b..e90d1078241 100644\n--- a/libstdc++-v3/include/debug/unordered_map\n+++ b/libstdc++-v3/include/debug/unordered_map\n@@ -581,6 +581,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_map> _Kt>\n+\tnode_type\n+\textract(_Kt&& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != _Base::end() ? _M_extract(__position) : {};\n+\t}\n+#endif\n+\n insert_return_type\n insert(node_type&& __nh)\n {\n@@ -713,6 +723,16 @@ namespace __debug\n \treturn __ret;\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_map> _Kt>\n+\tsize_type\n+\terase(_Kt&& __key)\n+\t{\n+\t auto __victim = _Base::find<_Kt>(__key);\n+\t return __victim != _Base::end() ? _M_erase(__victim), 1 : 0;\n+\t}\n+#endif\n+\n iterator\n erase(const_iterator __it)\n {\n@@ -1381,6 +1401,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_multimap> _Kt>\n+\tnode_type\n+\textract(_Kt&& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != _Base::end() ? _M_extract(__position) : {};\n+\t}\n+#endif\n+\n iterator\n insert(node_type&& __nh)\n { return { _Base::insert(std::move(__nh)), this }; }\n@@ -1510,6 +1540,25 @@ namespace __debug\n \treturn __ret;\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_multimap> _Kt>\n+\tsize_type\n+\terase(_Kt&& __key)\n+\t{\n+\t size_type __count(0);\n+\t size_type __bucket_count = this->bucket_count();\n+\t auto __victims = _Base::equal_range<_Kt>(__key);\n+\t for (auto __victim = __victims.first; __victim != __victims.second;)\n+\t {\n+\t _M_invalidate(__victim);\n+\t __victim = _Base::erase(__victim);\n+\t ++__count;\n+\t }\n+\t _M_check_rehashed(__bucket_count);\n+\t return __count;\n+\t}\n+#endif\n+\n iterator\n erase(const_iterator __it)\n {\ndiff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set\nindex de999a76890..6f4f4ae8f96 100644\n--- a/libstdc++-v3/include/debug/unordered_set\n+++ b/libstdc++-v3/include/debug/unordered_set\n@@ -468,6 +468,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_set> _Kt>\n+\tnode_type\n+\textract(_Kt&& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != _Base::end() ? _M_extract(__position) : {};\n+\t}\n+#endif\n+\n insert_return_type\n insert(node_type&& __nh)\n {\n@@ -598,6 +608,16 @@ namespace __debug\n \treturn __ret;\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_set> _Kt>\n+\tsize_type\n+\terase(_Kt&& __x)\n+\t{\n+\t auto __victim = _Base::find<_Kt>(__key);\n+\t return __victim != _Base::end() ? _M_erase(__victim), 1 : 0;\n+\t}\n+#endif\n+\n iterator\n erase(const_iterator __it)\n {\n@@ -1202,6 +1222,16 @@ namespace __debug\n \treturn {};\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_multiset> _Kt>\n+\tnode_type\n+\textract(const _Kt& __key)\n+\t{\n+\t const auto __position = _Base::find<_Kt>(__key);\n+\t return __position != _Base::end() ? _M_extract(__position) : {};\n+\t}\n+#endif\n+\n iterator\n insert(node_type&& __nh)\n { return { _Base::insert(std::move(__nh)), this }; }\n@@ -1318,18 +1348,38 @@ namespace __debug\n size_type\n erase(const key_type& __key)\n {\n-\tsize_type __ret(0);\n-\tauto __pair = _Base::equal_range(__key);\n-\tfor (auto __victim = __pair.first; __victim != __pair.second;)\n+\tsize_type __count(0);\n+\tsize_type __bucket_count = this->bucket_count();\n+\tauto __victims = _Base::equal_range(__key);\n+\tfor (auto __victim = __victims.first; __victim != __victims.second;)\n \t {\n \t _M_invalidate(__victim);\n \t __victim = _Base::erase(__victim);\n-\t ++__ret;\n+\t ++__count;\n \t }\n-\n-\treturn __ret;\n+\t_M_check_rehashed(__bucket_count);\n+\treturn __count;\n }\n \n+# ifdef __glibcxx_heterogeneous_container_erasure\n+ template <__heterogeneous_tree_key<unordered_multiset> _Kt>\n+\tsize_type\n+\terase(_Kt&& __key)\n+\t{\n+\t size_type __count(0);\n+\t size_type __bucket_count = this->bucket_count();\n+\t auto __victims = _Base::equal_range<_Kt>(__key);\n+\t for (auto __victim = __victims.first; __victim != __victims.second;)\n+\t {\n+\t _M_invalidate(__victim);\n+\t __victim = _Base::erase(__victim);\n+\t ++__count;\n+\t }\n+\t _M_check_rehashed(__bucket_count);\n+\t return __count;\n+\t}\n+#endif\n+\n iterator\n erase(const_iterator __it)\n {\n", "prefixes": [] }