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
  2024-06-20 14:43 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ 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] 3+ messages in thread

end of thread, other threads:[~2024-06-20 14:43 UTC | newest]

Thread overview: 3+ 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
2024-06-20 14:43 ` pinskia 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).