-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[C++20] Destroying delete can cause a type to be noexcept when deleting #118687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
10985bc
1de3f1f
f463154
b9be245
ecf14d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // RUN: %clang_cc1 -fsyntax-only -verify -fcxx-exceptions -Wno-unevaluated-expression -std=c++20 %s | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have maybe the test is better there and wrapped in a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That test file has a lot of dynamic exception specification code in it, so it's leaning heavily on |
||
| // expected-no-diagnostics | ||
|
|
||
| namespace std { | ||
| struct destroying_delete_t { | ||
| explicit destroying_delete_t() = default; | ||
| }; | ||
|
|
||
| inline constexpr destroying_delete_t destroying_delete{}; | ||
| } | ||
|
|
||
| struct Explicit { | ||
| ~Explicit() noexcept(false) {} | ||
|
|
||
| void operator delete(Explicit*, std::destroying_delete_t) noexcept { | ||
| } | ||
| }; | ||
|
|
||
| Explicit *qn = nullptr; | ||
| // This assertion used to fail, see GH118660 | ||
| static_assert(noexcept(delete(qn))); | ||
Uh oh!
There was an error while loading. Please reload this page.