public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "victor at westerhu dot is" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-114152-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114152

            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=57560&action=edit
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)) for
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.

             reply	other threads:[~2024-02-28 14:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 14:17 victor at westerhu dot is [this message]
2024-02-28 14:40 ` [Bug libstdc++/114152] " redi at gcc dot gnu.org
2024-02-28 14:42 ` victor at westerhu dot is
2024-02-28 14:47 ` redi at gcc dot gnu.org
2024-02-28 14:50 ` redi at gcc dot gnu.org
2024-02-28 14:51 ` cvs-commit at gcc dot gnu.org
2024-03-01 10:52 ` cvs-commit at gcc dot gnu.org
2024-03-01 10:53 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114152-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).