Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2226684/?format=api
{ "id": 2226684, "url": "http://patchwork.ozlabs.org/api/patches/2226684/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhuo67grsc.gcc.gcc-TEST.fdumont.47.1.2@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.hhuo67grsc.gcc.gcc-TEST.fdumont.47.1.2@forge-stage.sourceware.org>", "list_archive_url": null, "date": "2026-04-22T18:14:33", "name": "[v1,2/2] libstdc++: Fix const qualification of _GLIBCXX_DEBUG mode", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "fe747460d6000242c6a2f27ebdf9db658c81c935", "submitter": { "id": 93220, "url": "http://patchwork.ozlabs.org/api/people/93220/?format=api", "name": "François Dumont via Sourceware Forge", "email": "forge-bot+fdumont@forge-stage.sourceware.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhuo67grsc.gcc.gcc-TEST.fdumont.47.1.2@forge-stage.sourceware.org/mbox/", "series": [ { "id": 501071, "url": "http://patchwork.ozlabs.org/api/series/501071/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501071", "date": "2026-04-22T18:14:31", "name": "libstdc++: Make debug iterator pointer sequence const [PR116369]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501071/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2226684/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2226684/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 4g17650jDDz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 04:29:01 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 810C448FF188\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:28:57 +0000 (GMT)", "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 506794C91778\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:16:19 +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 A742843431\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:16:03 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 810C448FF188", "OpenDKIM Filter v2.11.0 sourceware.org 506794C91778" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 506794C91778", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 506794C91778", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776881779; cv=none;\n b=sVf7nQIpgPflHWKf0iI9m+Opdg04gxn1r0xCLXepuO09trd8HfyEZ+/WwguOBhCzKLat1PP8nrwAo+2guvtAlHgVVojHviPA1DC67ibcTAbYFD9E/RlVNZcb4tvPxf/2os7HBGlQ45YKCOPm1gHaih///2Tt+skvaqkU5sPwgsk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776881779; c=relaxed/simple;\n bh=JgjeVOPwwGkXpCvvOiHMFwA3c2DE9TbYVL+CK5u9bz0=;\n h=From:Date:Subject:MIME-Version:To:Message-ID;\n b=D1iW4AptEo6JxZxR+clw7kLqAucwkzsuss+SBV2j7BH3vXdaoo/7e351epF6oYS1cWNixpOzwHte7z0UCHN3hyfkgrlW8M9Jnj704cHqpvCbGrfCRQYMhz7xVsZtPlit5kAWip7W7e3srVvqkMJKkiHzyt/9bJHsvb1/cvOszZA=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "From": "=?utf-8?q?Fran=C3=A7ois_Dumont_via_Sourceware_Forge?=\n <forge-bot+fdumont@forge-stage.sourceware.org>", "Date": "Wed, 22 Apr 2026 18:14:33 +0000", "Subject": "[PATCH v1 2/2] libstdc++: Fix const qualification of _GLIBCXX_DEBUG\n mode", "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.hhuo67grsc.gcc.gcc-TEST.fdumont.47.1.2@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/47", "References": "\n <bmm.hhuo67grsc.gcc.gcc-TEST.fdumont.47.1.0@forge-stage.sourceware.org>", "In-Reply-To": "\n <bmm.hhuo67grsc.gcc.gcc-TEST.fdumont.47.1.0@forge-stage.sourceware.org>", "X-Patch-URL": "\n https://forge.sourceware.org/fdumont/gcc-TEST/commit/cbedd5f8679310d76c68edb1a00ad63f0882bded", "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>,\n fdumont@gcc.gnu.org", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "From: François Dumont <frs.dumont@gmail.com>\n\n---\n .../abi/pre/gnu-versioned-namespace.ver | 18 +--\n libstdc++-v3/config/abi/pre/gnu.ver | 14 ++\n libstdc++-v3/include/debug/safe_base.h | 28 ++--\n .../include/debug/safe_unordered_base.h | 30 +---\n libstdc++-v3/src/c++11/debug.cc | 130 +++++++++++++++---\n 5 files changed, 152 insertions(+), 68 deletions(-)", "diff": "diff --git a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver\nindex 2818ab3561f9..1c423ff2f572 100644\n--- a/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver\n+++ b/libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver\n@@ -117,11 +117,11 @@ GLIBCXX_8.0 {\n _ZN9__gnu_cxx3__818stdio_sync_filebufI[cw]NSt3__811char_traitsI[cw]EEE[5-9]*;\n \n # debug mode\n- _ZN11__gnu_debug19_Safe_sequence_base12_M_get_mutexEv;\n- _ZN11__gnu_debug19_Safe_sequence_base13_M_detach_allEv;\n- _ZN11__gnu_debug19_Safe_sequence_base18_M_detach_singularEv;\n- _ZN11__gnu_debug19_Safe_sequence_base22_M_revalidate_singularEv;\n- _ZN11__gnu_debug19_Safe_sequence_base7_M_swapERS0_;\n+ _ZNK11__gnu_debug19_Safe_sequence_base12_M_get_mutexEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base13_M_detach_allEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base18_M_detach_singularEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base22_M_revalidate_singularEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base7_M_swapERKS0_;\n \n _ZN11__gnu_debug19_Safe_iterator_base9_M_attach*;\n _ZN11__gnu_debug19_Safe_iterator_base16_M_attach_single*;\n@@ -136,11 +136,11 @@ GLIBCXX_8.0 {\n \n # __gnu_debug::_Safe_unordered_container_base\n # __gnu_debug::_Safe_local_iterator_base\n- _ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0_;\n- _ZN11__gnu_debug30_Safe_unordered_container_base13_M_detach_allEv;\n- _ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb;\n+ _ZNK11__gnu_debug30_Safe_unordered_container_base7_M_swapERKS0_;\n+ _ZNK11__gnu_debug30_Safe_unordered_container_base13_M_detach_allEv;\n+ _ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPKNS_30_Safe_unordered_container_baseEb;\n _ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv;\n- _ZN11__gnu_debug25_Safe_local_iterator_base16_M_attach_singleEPNS_19_Safe_sequence_baseEb;\n+ _ZN11__gnu_debug25_Safe_local_iterator_base16_M_attach_singleEPKNS_30_Safe_unordered_container_baseEb;\n \n # parallel mode\n _ZN14__gnu_parallel9_Settings3getEv;\ndiff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver\nindex 73b6f338613e..b5a89c31e0eb 100644\n--- a/libstdc++-v3/config/abi/pre/gnu.ver\n+++ b/libstdc++-v3/config/abi/pre/gnu.ver\n@@ -2555,6 +2555,20 @@ GLIBCXX_3.4.35 {\n _ZNSt8__detail17__wait_until_implEPKvRNS_16__wait_args_baseERKNSt6chrono8durationI[lx]St5ratioIL[lx]1EL[lx]1000000000EEEE;\n _ZNSt8__detail11__wait_args22_M_load_proxy_wait_valEPKv;\n \n+ # __gnu_debug::_Safe_iterator_base and _Safe_sequence_base const\n+ _ZN11__gnu_debug19_Safe_iterator_base9_M_attachEPKNS_19_Safe_sequence_baseEb;\n+ _ZN11__gnu_debug19_Safe_iterator_base16_M_attach_singleEPKNS_19_Safe_sequence_baseEb;\n+ _ZNK11__gnu_debug19_Safe_sequence_base13_M_detach_allEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base18_M_detach_singularEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base12_M_get_mutexEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base22_M_revalidate_singularEv;\n+ _ZNK11__gnu_debug19_Safe_sequence_base7_M_swapERKS0_;\n+\n+ # __gnu_debug::_Safe_local_iterator_base and _Safe_unordered_container_base const\n+ _ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPKNS_30_Safe_unordered_container_baseEb;\n+ _ZN11__gnu_debug25_Safe_local_iterator_base16_M_attach_singleEPKNS_30_Safe_unordered_container_baseEb;\n+ _ZNK11__gnu_debug30_Safe_unordered_container_base13_M_detach_allEv;\n+ _ZNK11__gnu_debug30_Safe_unordered_container_base7_M_swapERKS0_;\n } GLIBCXX_3.4.34;\n \n # Symbols in the support library (libsupc++) have their own tag.\ndiff --git a/libstdc++-v3/include/debug/safe_base.h b/libstdc++-v3/include/debug/safe_base.h\nindex 5719e40aedcc..44622970792b 100644\n--- a/libstdc++-v3/include/debug/safe_base.h\n+++ b/libstdc++-v3/include/debug/safe_base.h\n@@ -125,14 +125,12 @@ namespace __gnu_debug\n *\tunattached.\n */\n void\n- _M_attach(const _Safe_sequence_base* __seq, bool __constant)\n- { _M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); }\n+ _M_attach(const _Safe_sequence_base* __seq, bool __constant);\n \n /** Likewise, but not thread-safe. */\n void\n _M_attach_single(const _Safe_sequence_base* __seq,\n-\t\t bool __constant) _GLIBCXX_USE_NOEXCEPT\n- { _M_attach_single(const_cast<_Safe_sequence_base*>(__seq), __constant); }\n+\t\t bool __constant) _GLIBCXX_USE_NOEXCEPT;\n \n /** Detach the iterator for whatever sequence it is attached to,\n *\tif any.\n@@ -140,6 +138,7 @@ namespace __gnu_debug\n void\n _M_detach();\n \n+#if !_GLIBCXX_INLINE_VERSION\n private:\n /***************************************************************/\n /** Not-const method preserved for abi backward compatibility. */\n@@ -150,6 +149,7 @@ namespace __gnu_debug\n _M_attach_single(_Safe_sequence_base* __seq,\n \t\t bool __constant) _GLIBCXX_USE_NOEXCEPT;\n /***************************************************************/\n+#endif\n \n public:\n /** Likewise, but not thread-safe. */\n@@ -262,16 +262,14 @@ namespace __gnu_debug\n \n /** Detach all iterators, leaving them singular. */\n void\n- _M_detach_all() const\n- { const_cast<_Safe_sequence_base*>(this)->_M_detach_all(); }\n+ _M_detach_all() const;\n \n /** Detach all singular iterators.\n * @post for all iterators i attached to this sequence,\n * i->_M_version == _M_version.\n */\n void\n- _M_detach_singular() const\n- { const_cast<_Safe_sequence_base*>(this)->_M_detach_singular(); }\n+ _M_detach_singular() const;\n \n /** Revalidates all attached singular iterators. This method may\n * be used to validate iterators that were invalidated before\n@@ -279,8 +277,7 @@ namespace __gnu_debug\n * valid again).\n */\n void\n- _M_revalidate_singular() const\n- { const_cast<_Safe_sequence_base*>(this)->_M_revalidate_singular(); }\n+ _M_revalidate_singular() const;\n \n /** Swap this sequence with the given sequence. This operation\n * also swaps ownership of the iterators, so that when the\n@@ -288,16 +285,11 @@ namespace __gnu_debug\n * one container now reference the other container.\n */\n void\n- _M_swap(const _Safe_sequence_base& __x) const _GLIBCXX_USE_NOEXCEPT\n- {\n- const_cast<_Safe_sequence_base*>(this)->_M_swap\n-\t(const_cast<_Safe_sequence_base&>(__x));\n- }\n+ _M_swap(const _Safe_sequence_base& __x) const _GLIBCXX_USE_NOEXCEPT;\n \n /** For use in _Safe_sequence. */\n __gnu_cxx::__mutex&\n- _M_get_mutex() const _GLIBCXX_USE_NOEXCEPT\n- { return const_cast<_Safe_sequence_base*>(this)->_M_get_mutex(); }\n+ _M_get_mutex() const _GLIBCXX_USE_NOEXCEPT;\n \n /** Invalidates all iterators. */\n void\n@@ -305,6 +297,7 @@ namespace __gnu_debug\n { if (++_M_version == 0) _M_version = 1; }\n \n private:\n+#if !_GLIBCXX_INLINE_VERSION\n /***************************************************************/\n /** Not-const method preserved for abi backward compatibility. */\n void\n@@ -322,6 +315,7 @@ namespace __gnu_debug\n __gnu_cxx::__mutex&\n _M_get_mutex() _GLIBCXX_USE_NOEXCEPT;\n /***************************************************************/\n+#endif\n \n /** Attach an iterator to this sequence. */\n void\ndiff --git a/libstdc++-v3/include/debug/safe_unordered_base.h b/libstdc++-v3/include/debug/safe_unordered_base.h\nindex 169cd6961764..55cf581e315e 100644\n--- a/libstdc++-v3/include/debug/safe_unordered_base.h\n+++ b/libstdc++-v3/include/debug/safe_unordered_base.h\n@@ -102,6 +102,7 @@ namespace __gnu_debug\n void\n _M_detach_single() noexcept;\n \n+#if !_GLIBCXX_INLINE_VERSION\n private:\n /***************************************************************/\n /** Not-const method preserved for abi backward compatibility. */\n@@ -111,6 +112,7 @@ namespace __gnu_debug\n void\n _M_attach_single(_Safe_sequence_base* __seq, bool __constant) noexcept;\n /***************************************************************/\n+#endif\n };\n \n /**\n@@ -167,8 +169,7 @@ namespace __gnu_debug\n \n /** Detach all iterators, leaving them singular. */\n void\n- _M_detach_all() const\n- { const_cast<_Safe_unordered_container_base*>(this)->_M_detach_all(); }\n+ _M_detach_all() const;\n \n /** Swap this container with the given container. This operation\n * also swaps ownership of the iterators, so that when the\n@@ -176,13 +177,10 @@ namespace __gnu_debug\n * one container now reference the other container.\n */\n void\n- _M_swap(const _Safe_unordered_container_base& __x) const noexcept\n- {\n- const_cast<_Safe_unordered_container_base*>(this)->_M_swap\n-\t(const_cast<_Safe_unordered_container_base&>(__x));\n- }\n+ _M_swap(const _Safe_unordered_container_base& __x) const noexcept;\n \n private:\n+#if !_GLIBCXX_INLINE_VERSION\n /***************************************************************/\n /** Not-const method preserved for abi backward compatibility. */\n void\n@@ -191,6 +189,7 @@ namespace __gnu_debug\n void\n _M_swap(_Safe_unordered_container_base& __x) noexcept;\n /***************************************************************/\n+#endif\n \n /** Attach an iterator to this container. */\n void\n@@ -214,23 +213,6 @@ namespace __gnu_debug\n _Safe_local_iterator_base::\n _M_safe_container() const noexcept\n { return static_cast<const _Safe_unordered_container_base*>(_M_sequence); }\n-\n- inline void\n- _Safe_local_iterator_base::\n- _M_attach(const _Safe_unordered_container_base* __cont, bool __constant)\n- {\n- const _Safe_sequence_base* __seq = __cont;\n- _M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant);\n- }\n-\n- inline void\n- _Safe_local_iterator_base::\n- _M_attach_single(const _Safe_unordered_container_base* __cont,\n-\t\t bool __constant) noexcept\n- {\n- const _Safe_sequence_base* __seq = __cont;\n- _M_attach_single(const_cast<_Safe_sequence_base*>(__seq), __constant);\n- }\n } // namespace __gnu_debug\n \n #endif\ndiff --git a/libstdc++-v3/src/c++11/debug.cc b/libstdc++-v3/src/c++11/debug.cc\nindex 92c76ac6eb94..c6f6ef7ecb74 100644\n--- a/libstdc++-v3/src/c++11/debug.cc\n+++ b/libstdc++-v3/src/c++11/debug.cc\n@@ -327,7 +327,7 @@ namespace __gnu_debug\n \n void\n _Safe_sequence_base::\n- _M_detach_all()\n+ _M_detach_all() const\n {\n __gnu_cxx::__scoped_lock sentry(_M_get_mutex());\n detach_all(_M_iterators);\n@@ -339,7 +339,7 @@ namespace __gnu_debug\n \n void\n _Safe_sequence_base::\n- _M_detach_singular()\n+ _M_detach_singular() const\n {\n __gnu_cxx::__scoped_lock sentry(_M_get_mutex());\n for (_Safe_iterator_base* __iter = _M_iterators; __iter;)\n@@ -361,7 +361,7 @@ namespace __gnu_debug\n \n void\n _Safe_sequence_base::\n- _M_revalidate_singular()\n+ _M_revalidate_singular() const\n {\n __gnu_cxx::__scoped_lock sentry(_M_get_mutex());\n for (_Safe_iterator_base* __iter = _M_iterators; __iter;\n@@ -375,14 +375,56 @@ namespace __gnu_debug\n \n void\n _Safe_sequence_base::\n- _M_swap(_Safe_sequence_base& __x) noexcept\n+ _M_swap(const _Safe_sequence_base& __x) const noexcept\n { swap_seq(_M_get_mutex(), *this, __x._M_get_mutex(), __x); }\n \n __gnu_cxx::__mutex&\n _Safe_sequence_base::\n- _M_get_mutex() noexcept\n+ _M_get_mutex() const noexcept\n { return get_safe_base_mutex(this); }\n \n+#if !_GLIBCXX_INLINE_VERSION\n+ void\n+ _Safe_sequence_base::\n+ _M_detach_all()\n+ {\n+ const _Safe_sequence_base* __this = this;\n+ __this->_M_detach_all();\n+ }\n+\n+ void\n+ _Safe_sequence_base::\n+ _M_detach_singular()\n+ {\n+ const _Safe_sequence_base* __this = this;\n+ __this->_M_detach_singular();\n+ }\n+\n+ void\n+ _Safe_sequence_base::\n+ _M_revalidate_singular()\n+ {\n+ const _Safe_sequence_base* __this = this;\n+ __this->_M_revalidate_singular();\n+ }\n+\n+ void\n+ _Safe_sequence_base::\n+ _M_swap(_Safe_sequence_base& __x) noexcept\n+ {\n+ const _Safe_sequence_base* __this = this;\n+ __this->_M_swap(__x);\n+ }\n+\n+ __gnu_cxx::__mutex&\n+ _Safe_sequence_base::\n+ _M_get_mutex() noexcept\n+ {\n+ const _Safe_sequence_base* __this = this;\n+ return __this->_M_get_mutex();\n+ }\n+#endif\n+\n void\n _Safe_sequence_base::\n _M_attach(_Safe_iterator_base* __it, bool __constant) const\n@@ -426,7 +468,7 @@ namespace __gnu_debug\n \n void\n _Safe_iterator_base::\n- _M_attach(_Safe_sequence_base* __seq, bool __constant)\n+ _M_attach(const _Safe_sequence_base* __seq, bool __constant)\n {\n _M_detach();\n \n@@ -443,7 +485,7 @@ namespace __gnu_debug\n \n void\n _Safe_iterator_base::\n- _M_attach_single(_Safe_sequence_base* __seq, bool __constant) noexcept\n+ _M_attach_single(const _Safe_sequence_base* __seq, bool __constant) noexcept\n {\n _M_detach_single();\n \n@@ -514,9 +556,27 @@ namespace __gnu_debug\n _M_get_mutex() noexcept\n { return _M_sequence->_M_get_mutex(); }\n \n+#if !_GLIBCXX_INLINE_VERSION\n+ void\n+ _Safe_iterator_base::\n+ _M_attach(_Safe_sequence_base* __seq, bool __constant)\n+ {\n+ const _Safe_sequence_base* __cseq = __seq;\n+ _M_attach(__cseq, __constant);\n+ }\n+\n+ void\n+ _Safe_iterator_base::\n+ _M_attach_single(_Safe_sequence_base* __seq, bool __constant) noexcept\n+ {\n+ const _Safe_sequence_base* __cseq = __seq;\n+ _M_attach_single(__cseq, __constant);\n+ }\n+#endif\n+\n void\n _Safe_local_iterator_base::\n- _M_attach(_Safe_sequence_base* __cont, bool __constant)\n+ _M_attach(const _Safe_unordered_container_base* __cont, bool __constant)\n {\n _M_detach();\n \n@@ -533,7 +593,8 @@ namespace __gnu_debug\n \n void\n _Safe_local_iterator_base::\n- _M_attach_single(_Safe_sequence_base* __cont, bool __constant) noexcept\n+ _M_attach_single(const _Safe_unordered_container_base* __cont,\n+\t\t bool __constant) noexcept\n {\n _M_detach_single();\n \n@@ -570,12 +631,31 @@ namespace __gnu_debug\n }\n }\n \n+#if !_GLIBCXX_INLINE_VERSION\n+ void\n+ _Safe_local_iterator_base::\n+ _M_attach(_Safe_sequence_base* __seq, bool __constant)\n+ {\n+ const _Safe_unordered_container_base* __cont\n+ = static_cast<_Safe_unordered_container_base*>(__seq);\n+ _M_attach(__cont, __constant);\n+ }\n+\n+ void\n+ _Safe_local_iterator_base::\n+ _M_attach_single(_Safe_sequence_base* __seq, bool __constant) noexcept\n+ {\n+ const _Safe_unordered_container_base* __cont\n+ = static_cast<_Safe_unordered_container_base*>(__seq);\n+ _M_attach_single(__cont, __constant);\n+ }\n+#endif\n+\n void\n _Safe_unordered_container_base::\n- _M_detach_all()\n+ _M_detach_all() const\n {\n- const _Safe_unordered_container_base& __cont = *this;\n- __gnu_cxx::__scoped_lock sentry(__cont._M_get_mutex());\n+ __gnu_cxx::__scoped_lock sentry(_M_get_mutex());\n detach_all(_M_iterators);\n _M_iterators = 0;\n \n@@ -591,12 +671,8 @@ namespace __gnu_debug\n \n void\n _Safe_unordered_container_base::\n- _M_swap(_Safe_unordered_container_base& __x) noexcept\n- {\n- const _Safe_unordered_container_base& __cont = *this;\n- const _Safe_unordered_container_base& __x_cont = __x;\n- swap_ucont(__cont._M_get_mutex(), *this, __x_cont._M_get_mutex(), __x);\n- }\n+ _M_swap(const _Safe_unordered_container_base& __x) const noexcept\n+ { swap_ucont(_M_get_mutex(), *this, __x._M_get_mutex(), __x); }\n \n void\n _Safe_unordered_container_base::\n@@ -638,6 +714,24 @@ namespace __gnu_debug\n if (_M_local_iterators == __it)\n _M_local_iterators = __it->_M_next;\n }\n+\n+#if !_GLIBCXX_INLINE_VERSION\n+ void\n+ _Safe_unordered_container_base::\n+ _M_detach_all()\n+ {\n+ const _Safe_unordered_container_base* __this = this;\n+ __this->_M_detach_all();\n+ }\n+\n+ void\n+ _Safe_unordered_container_base::\n+ _M_swap(_Safe_unordered_container_base& __x) noexcept\n+ {\n+ const _Safe_unordered_container_base* __this = this;\n+ __this->_M_swap(__x);\n+ }\n+#endif\n }\n \n namespace\n", "prefixes": [ "v1", "2/2" ] }