public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/114152] New: Wrong exception specifiers for LFTSv3 scope guard destructors
@ 2024-02-28 14:17 victor at westerhu dot is
  2024-02-28 14:40 ` [Bug libstdc++/114152] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: victor at westerhu dot is @ 2024-02-28 14:17 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-01 10:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28 14:17 [Bug libstdc++/114152] New: Wrong exception specifiers for LFTSv3 scope guard destructors victor at westerhu dot is
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

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).