{"id":2226501,"url":"http://patchwork.ozlabs.org/api/patches/2226501/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/20260422141753.1133689-1-tkaminsk@redhat.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","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":"<20260422141753.1133689-1-tkaminsk@redhat.com>","list_archive_url":null,"date":"2026-04-22T14:16:41","name":"libstdc++: Include bool conversion in noexcept specification of indirect::operator==.","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a57c00d29e5cc8cd96f054f82cebc36c98999537","submitter":{"id":90409,"url":"http://patchwork.ozlabs.org/api/people/90409/?format=json","name":"Tomasz Kamiński","email":"tkaminsk@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/20260422141753.1133689-1-tkaminsk@redhat.com/mbox/","series":[{"id":501018,"url":"http://patchwork.ozlabs.org/api/series/501018/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=501018","date":"2026-04-22T14:16:41","name":"libstdc++: Include bool conversion in noexcept specification of indirect::operator==.","version":1,"mbox":"http://patchwork.ozlabs.org/series/501018/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226501/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226501/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\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=gre0gaJU;\n\tdkim-atps=neutral","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;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=gre0gaJU","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"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 4g11YB5RKpz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 00:18:37 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 51D1A4BB3BA2\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 14:18:35 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id 2CF704BA2E0E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 14:18:00 +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-206-L2-LTTJgPpG6W6JlLh8rVg-1; Wed,\n 22 Apr 2026 10:17:56 -0400","from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\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 6FE301800358; Wed, 22 Apr 2026 14:17:55 +0000 (UTC)","from localhost (unknown [10.44.48.183])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id B7404180047F; Wed, 22 Apr 2026 14:17:54 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 51D1A4BB3BA2","OpenDKIM Filter v2.11.0 sourceware.org 2CF704BA2E0E"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 2CF704BA2E0E","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 2CF704BA2E0E","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776867480; cv=none;\n b=A1jZhLxyL/vSqDYbGGOSF6SA5QRYJZRTn3y8TfHSxX8OagjgkyOXpbm0Q3TeXQSDkJKdUrgE9Y9hYT7jY2EZrGohfvjRpPmjYbSJRiXhQW1RAjBW+efJKKDw6HG9W1QcBMs2XM+5zMX4RM+vRR2h9jwt+t4gnFLqvsHdgWnKuW4=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776867480; c=relaxed/simple;\n bh=rvvBSDLtW5x7p2THL6pGWXcG6Rrcg80AOvBTQM1nH8w=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=WAzklXX7a+0/QN59IyakWN4t6IHDWXPloS8eqLa0+XkpCliJLwMv9BXjW6YGKFNSbjtToE2PvqJVqJY51rUa6qtKxF4TGBYTO/AjDvDUZJQQNO1jZ4BU1RCOpk89fJFGf6GIlJa+s7w8nXLTXXvHRiCy5F5aSANV8hkZegK13Jw=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776867479;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=nLAi6v8MJXUWyjDSSf6hKOe9r88dVQamvaXkNVnXK7s=;\n b=gre0gaJU8Xk3b62wLxgT1yWfutR0dcukFGHBatlNNb4m6ZvtS4NUUtYLWd2PeRxTqZCoLV\n VRoMuTrhOcstcYARmxw8k6Z6KiJtJcc+Iw99k9Bzane4QoTp7JWcc5SOJp4R2aQ/9lfj7g\n 5OIv4DtJFdvC80kBo/7kjUg3i8C7tSM=","X-MC-Unique":"L2-LTTJgPpG6W6JlLh8rVg-1","X-Mimecast-MFC-AGG-ID":"L2-LTTJgPpG6W6JlLh8rVg_1776867475","From":"=?utf-8?q?Tomasz_Kami=C5=84ski?= <tkaminsk@redhat.com>","To":"libstdc++@gcc.gnu.org,\n\tgcc-patches@gcc.gnu.org","Subject":"[PATCH] libstdc++: Include bool conversion in noexcept specification\n of indirect::operator==.","Date":"Wed, 22 Apr 2026 16:16:41 +0200","Message-ID":"<20260422141753.1133689-1-tkaminsk@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.93","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"wClvGzcD6aloMQ7skpq9l7rzZibYowuQAg4vUTQf7bQ_1776867475","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","content-type":"text/plain; charset=\"US-ASCII\"; 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":"This expands the resolution of LWG4325 to heterogenous comparision\nwith T per standard draft (see corresponding commit [1]).\n\n[1] https://github.com/cplusplus/draft/pull/8935/changes/833d635d648cdbd06c9935acccf925ee0aea3c79\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/indirect.h (indirect::operator==): Adjust\n\tnoexcept specification.\n\t* testsuite/std/memory/indirect/relops.cc: New test for noexcept\n\tspecification.\n---\nTested only *indirect* test at this moment. Will not be able to merge\nit until tomorrow.\n\nTesting on x86_64-linux. OK for trunk if all test passes?\n\n libstdc++-v3/include/bits/indirect.h          |  4 +-\n .../testsuite/std/memory/indirect/relops.cc   | 43 +++++++++++++++++++\n 2 files changed, 45 insertions(+), 2 deletions(-)","diff":"diff --git a/libstdc++-v3/include/bits/indirect.h b/libstdc++-v3/include/bits/indirect.h\nindex 6490a77a507..5be6713eaf3 100644\n--- a/libstdc++-v3/include/bits/indirect.h\n+++ b/libstdc++-v3/include/bits/indirect.h\n@@ -336,7 +336,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \trequires requires (const _Tp& __t, const _Up& __u) { __t == __u; }\n \tfriend constexpr bool\n \toperator==(const indirect& __lhs, const indirect<_Up, _Alloc2>& __rhs)\n-\tnoexcept(noexcept(*__lhs == *__rhs))\n+\tnoexcept(noexcept(bool(*__lhs == *__rhs)))\n \t{\n \t  if (!__lhs._M_objp || !__rhs._M_objp)\n \t    return bool(__lhs._M_objp) == bool(__rhs._M_objp);\n@@ -349,7 +349,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \t  && requires (const _Tp& __t, const _Up& __u) { __t == __u; }\n \tfriend constexpr bool\n \toperator==(const indirect<_Vp, _Alloc>& __lhs, const _Up& __rhs)\n-\tnoexcept(noexcept(*__lhs == __rhs))\n+\tnoexcept(noexcept(bool(*__lhs == __rhs)))\n \t{\n \t  if (!__lhs._M_objp)\n \t    return false;\ndiff --git a/libstdc++-v3/testsuite/std/memory/indirect/relops.cc b/libstdc++-v3/testsuite/std/memory/indirect/relops.cc\nindex 77d599c8086..25ebf524e2b 100644\n--- a/libstdc++-v3/testsuite/std/memory/indirect/relops.cc\n+++ b/libstdc++-v3/testsuite/std/memory/indirect/relops.cc\n@@ -68,11 +68,54 @@ test_hash()\n   (void)std::hash<std::indirect<Obj>>{}(i);\n }\n \n+template<bool Noexcept>\n+struct BoolConv\n+{\n+  bool b;\n+\n+  constexpr BoolConv(bool p) noexcept\n+  : b(p)\n+  { }\n+\n+  constexpr operator bool() const noexcept(Noexcept)\n+  { return b; }\n+};\n+\n+template<bool NoexceptEq, typename Ret = bool>\n+struct Comp\n+{\n+  friend constexpr Ret\n+  operator==(const Comp&, const Comp&) noexcept(NoexceptEq)\n+  { return true; }\n+};\n+\n+template<bool NoexceptEq, typename T>\n+void test_noexcept(T t)\n+{\n+  std::indirect<T> i(t);\n+  static_assert(noexcept(i == t) == NoexceptEq);\n+  static_assert(noexcept(i != t) == NoexceptEq);\n+  static_assert(noexcept(i == i) == NoexceptEq);\n+  static_assert(noexcept(i != i) == NoexceptEq);\n+}\n+\n+void test_noexcept()\n+{\n+  test_noexcept<true>(Comp<true>());\n+  test_noexcept<false>(Comp<false>());\n+\n+  test_noexcept<true>(Comp<true, BoolConv<true>>());\n+  test_noexcept<false>(Comp<true, BoolConv<false>>());\n+  test_noexcept<false>(Comp<false, BoolConv<true>>());\n+  test_noexcept<false>(Comp<false, BoolConv<false>>());\n+}\n+\n int main()\n {\n   test_relops();\n   test_comp_with_t();\n   test_hash();\n+  test_noexcept();\n \n   static_assert([] {\n     test_relops();\n","prefixes":[]}