From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0C8A43858C62; Wed, 28 Feb 2024 14:17:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C8A43858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709129855; bh=zVenP6p35lR00zLIMIiWFneAtSS5Zb7TRmliEJdZVbg=; h=From:To:Subject:Date:From; b=TCtbNCpm6rtsFUnCmK3hS/k3rgfKUxMPOx91IztuEUrzhM1AxFv4Xr4wGDrZvwqCO QLpzaVR6U8zePJ2A8nWed/ab2H941vnF4ZoOJCMYllNemTVFU3eBG1ESCgonLdS+Tb SiP8S12fbKKaNd/c7twip4Zl2nQEUohdUs0eqshI= From: "victor at westerhu dot is" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114152] New: Wrong exception specifiers for LFTSv3 scope guard destructors Date: Wed, 28 Feb 2024 14:17:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: victor at westerhu dot is X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114152 Bug ID: 114152 Summary: Wrong exception specifiers for LFTSv3 scope guard destructors Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: victor at westerhu dot is Target Milestone: --- Created attachment 57560 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57560&action=3Dedit Patch According to the (draft) specification of the C++ Extensions for Library Fundamentals, Version 3 (https://cplusplus.github.io/fundamentals-ts/v3.html#scopeguard.exit), the destructors of std::experimental::scope_{exit,failure} should be unconditionally noexcept. The destructor of std::experimental::scope_success should be noexcept if calling the exit function is noexcept. The current implementation has noexcept(noexcept(this->_M_exit_function)) f= or all three, which is wrong for all. It is even wrong for std::experimental::scope_success, because it's missing the needed `()' for actually testing the function call. This error is present since the first addition of the scope guards. I have attached the 3-line patch needed to fix this.=