From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5A1E53858D32 for ; Sun, 20 Aug 2023 13:33:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A1E53858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692538432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pqhxQcA7EgkZ/EoO5soRWV3MnYjNG1a33i3+laqRgg0=; b=OPPrWQDjPoX2K1UdvhKekEVIGVyt091dqETF6x50Zdg4MBiWrbjFg1ZHDrnQoAsyPQ1nw5 ECJKNb/lxYKA2cPoin8+EsdzkTK66Gh7LtpVwPw9PUJH8nwympWaa2RWK6dpcb4CaWtjRO 4bJ3XC9fXN0940UnRPVinvUzvy/GaCI= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-Ej1MDyPSMwGMH9fB2njx2w-1; Sun, 20 Aug 2023 09:33:50 -0400 X-MC-Unique: Ej1MDyPSMwGMH9fB2njx2w-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2bb93f9a54fso23975341fa.3 for ; Sun, 20 Aug 2023 06:33:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692538429; x=1693143229; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pqhxQcA7EgkZ/EoO5soRWV3MnYjNG1a33i3+laqRgg0=; b=Rvj6FGkZCv76PmaD7fjcjewU6akl58yLwAeBRXmXPsOGB88ljT886qTPuyVawEvnFJ aZVyGNEycd30X1VqFbKBRsBcVsLwA1xgh809HLZ15mYb0hnybFS2t3eKs6QAjSltJSyL yt3SW0Md6bVGA/5bDVlTa8KITW1tHWNRoHpdRyL+DEZUQgYXWJjLPUz0HUg97hU7k0te UPw8RW+EdMDr3NOIDzQjMdkcBkkeJM9r1bbu0l6Td5wmSIuNPedBFPF/Hnc9E8fk5VVk rptonIiMN8dYRE8sjPdTAej+aXzXRa/giMYwxmJCpxB1TS3aTEhgZnx2kZXxhYbm70VM VPPA== X-Gm-Message-State: AOJu0YwB3mmNPq+eDdqAcPpbwH9q1l+D3a2yZZ4Kh7RIcAFfeQndVz05 HPCCciuqPf7JfJ0e/ow2mVdFx2PpXbQS8ZA1VaQoxX3I/Smu/kDJ0qn7gh3VX05xjs6/YX9h+zp Irl+d95E3473zFlMLep2FLoGSmhD8/zY= X-Received: by 2002:a2e:980e:0:b0:2bb:acf1:a18 with SMTP id a14-20020a2e980e000000b002bbacf10a18mr2927383ljj.44.1692538429219; Sun, 20 Aug 2023 06:33:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbRuDZCfv0ITAI3w7J/nD+b8aSuVD3Ww2TQiRhHdGHJMKOCMcEfBppGncdzbIdn/z5to+pxVEDRWRNuscYsZI= X-Received: by 2002:a2e:980e:0:b0:2bb:acf1:a18 with SMTP id a14-20020a2e980e000000b002bbacf10a18mr2927375ljj.44.1692538428913; Sun, 20 Aug 2023 06:33:48 -0700 (PDT) MIME-Version: 1.0 References: <5E303765-CCB8-4AC3-B757-3B3DAB44A675@sandoe.co.uk> In-Reply-To: <5E303765-CCB8-4AC3-B757-3B3DAB44A675@sandoe.co.uk> From: Jonathan Wakely Date: Sun, 20 Aug 2023 14:33:38 +0100 Message-ID: Subject: Re: 18_support/nested_exception/rethrow_if_nested-term.cc To: Iain Sandoe Cc: libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, 20 Aug 2023 at 14:01, Iain Sandoe wrote: > > Hi Jonathan, > > > On 20 Aug 2023, at 12:21, Jonathan Wakely wrote: > > > > On Sun, 20 Aug 2023 at 11:08, Iain Sandoe wrote: > > > > >> So, ISTM that the difference is not in the actual nested exception han= dling (including the conditional rethrow) but lies, instead in a different = interpretation of when the changes from set_terminate() take effect. > > > > I don't think it's when the changes take effect, that has to be > > instant (i.e. get_terminate() must return the new handler > > immediately). It's whether std::terminate() actually uses the result > > of std::get_terminate() or uses the active exception's stored handler. > > It would seem the latter (but I did not read the code so far). > > >> =E2=80=94 it needs someone with state on the history of this to commen= t =E2=80=A6 > >> > >> a) does that seem like a reasonable analysis? > >> b) would it be acceptable to move the set_terminate () call? > > > > I didn't intend this test to depend on unspecified behaviour. But just > > moving it before the throw would mean that if std::throw_with_nested > > terminates for some reason, we would exit cleanly and the test would > > pass, which we don't want. > > right. > > > I would prefer the attached change instead. I assume this works with > > both runtimes? > > (This also gives a FAIL if throw_with_nested returns normally for some > > reason, which would also currently PASS.) > > Yes, it works with GCC (supc++) clang (main at least) and GCC (c++abi WIP= ) Great. I can commit it tomorrow, or feel free to do so yourself. > thanks > Iain >