public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114844] New: A trivial but noexcept(false) destructor is incorrectly considered non-throwing
@ 2024-04-25  6:39 de34 at live dot cn
  2024-04-25 16:16 ` [Bug c++/114844] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: de34 at live dot cn @ 2024-04-25  6:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114844
           Summary: A trivial but noexcept(false) destructor is
                    incorrectly considered non-throwing
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: de34 at live dot cn
  Target Milestone: ---

Currently, GCC incorrectly accepts the following code snippet (allowed by
P1286R2), which conflicts with [except.spec]/6.2.

```
struct TrivialButPotentiallyThrowingDestructor {
    TrivialButPotentiallyThrowingDestructor() = default;
    ~TrivialButPotentiallyThrowingDestructor() noexcept(false) = default;
};

static_assert(noexcept(TrivialButPotentiallyThrowingDestructor{}), "???");
```

It's curious that other compilers except for EDG also get this wrong
(https://godbolt.org/z/57jf98xhc).

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

* [Bug c++/114844] A trivial but noexcept(false) destructor is incorrectly considered non-throwing
  2024-04-25  6:39 [Bug c++/114844] New: A trivial but noexcept(false) destructor is incorrectly considered non-throwing de34 at live dot cn
@ 2024-04-25 16:16 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-04-25 16:16 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This reminds me of my old patch:
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg00311.html
this sounds like the problem I hit when working on the patch.

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

end of thread, other threads:[~2024-04-25 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25  6:39 [Bug c++/114844] New: A trivial but noexcept(false) destructor is incorrectly considered non-throwing de34 at live dot cn
2024-04-25 16:16 ` [Bug c++/114844] " mpolacek 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).