diff options
| author | Martin Hořeňovský | 2026-09-02 20:53:47 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2026-09-05 15:24:15 +0200 |
| commit | ace418200064a2467441f565f74ac41cf5884150 (patch) | |
| tree | e4424ad881d8cfff0dd368d99873607c18d4a637 /src/catch2/internal/catch_assertion_handler.hpp | |
| parent | d59be347677feae83d352e7a4d7f04082632e9ac (diff) | |
| download | catch3-devel-noexcept-funcs.tar.gz | |
WIP: More noexceptdevel-noexcept-funcs
Diffstat (limited to 'src/catch2/internal/catch_assertion_handler.hpp')
| -rw-r--r-- | src/catch2/internal/catch_assertion_handler.hpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/catch2/internal/catch_assertion_handler.hpp b/src/catch2/internal/catch_assertion_handler.hpp index b92b80eb..d7d3719e 100644 --- a/src/catch2/internal/catch_assertion_handler.hpp +++ b/src/catch2/internal/catch_assertion_handler.hpp @@ -55,17 +55,22 @@ namespace Catch { void handleMessage(ResultWas::OfType resultType, std::string&& message); - void handleExceptionThrownAsExpected(); - void handleUnexpectedExceptionNotThrown(); - void handleExceptionNotThrownAsExpected(); - void handleThrowingCallSkipped(); // TODO: // * called from catch (...) blocks in assertions // * doesn't propagate exception - // * Allows the compiler to skip adding more exception edges in catch (...) when it cannot throw + // * Allows the compiler to skip adding more exception edges in catch + // (...) when it cannot throw // * compilation is faster - // * abort on throw inside is fine -> this is called when another exception is called, so it would abort anyway + // * abort on throw inside is fine -> this is called when another + // exception is called, so it would abort anyway void handleUnexpectedInflightException() noexcept; + // TODO: + // * similar reasoning as above, unified comment for both + void handleExceptionThrownAsExpected() noexcept; + + void handleUnexpectedExceptionNotThrown(); + void handleExceptionNotThrownAsExpected(); + void handleThrowingCallSkipped(); void complete(); @@ -73,7 +78,12 @@ namespace Catch { auto allowThrows() const -> bool; }; - void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str ); + // Like the two handlers above, this is only ever called from inside the + // `catch` block of an assertion macro, so an exception escaping it would + // already terminate. Saying so explicitly keeps the compiler from emitting + // a nested exception edge at every expansion of `REQUIRE_THROWS_WITH` and + // friends. + void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str ) noexcept; } // namespace Catch |