[LV] Add test showing debug output for loops with uncountable BTCs.
[llvm-project.git] / clang / test / SemaCXX / noexcept-destroying-delete.cpp
blob92ccbc1fb3f96b1f3f9720b1e339f32d79767048
1 // RUN: %clang_cc1 -fsyntax-only -verify -fcxx-exceptions -Wno-unevaluated-expression -std=c++20 %s
2 // expected-no-diagnostics
4 namespace std {
5 struct destroying_delete_t {
6 explicit destroying_delete_t() = default;
7 };
9 inline constexpr destroying_delete_t destroying_delete{};
12 struct Explicit {
13 ~Explicit() noexcept(false) {}
15 void operator delete(Explicit*, std::destroying_delete_t) noexcept {
19 Explicit *qn = nullptr;
20 // This assertion used to fail, see GH118660
21 static_assert(noexcept(delete(qn)));
23 struct ThrowingDestroyingDelete {
24 ~ThrowingDestroyingDelete() noexcept(false) {}
26 void operator delete(ThrowingDestroyingDelete*, std::destroying_delete_t) noexcept(false) {
30 ThrowingDestroyingDelete *pn = nullptr;
31 // noexcept should return false here because the destroying delete itself is a
32 // potentially throwing function.
33 static_assert(!noexcept(delete(pn)));