Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

WIP: noexcept in handleUnexpectedInFlightException

Commit
1d406997a25f07854191be2552f82d6612247ae2
Author
Martin Hořeňovský ·
Parents
897d8043eb19

Files · Download .tar.gz

Changes

 src/catch2/internal/catch_assertion_handler.cpp | 2 +-
 src/catch2/internal/catch_assertion_handler.hpp | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/catch2/internal/catch_assertion_handler.cpp b/src/catch2/internal/catch_assertion_handler.cpp
index 79d5dcd8..e028c371 100644
--- a/src/catch2/internal/catch_assertion_handler.cpp
+++ b/src/catch2/internal/catch_assertion_handler.cpp
@@ -61,7 +61,7 @@ namespace Catch {
         }
     }
 
-    void AssertionHandler::handleUnexpectedInflightException() {
+    void AssertionHandler::handleUnexpectedInflightException() noexcept {
         m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
     }
 
diff --git a/src/catch2/internal/catch_assertion_handler.hpp b/src/catch2/internal/catch_assertion_handler.hpp
index 93a70b1a..600ddbd5 100644
--- a/src/catch2/internal/catch_assertion_handler.hpp
+++ b/src/catch2/internal/catch_assertion_handler.hpp
@@ -59,7 +59,12 @@ namespace Catch {
         void handleUnexpectedExceptionNotThrown();
         void handleExceptionNotThrownAsExpected();
         void handleThrowingCallSkipped();
-        void handleUnexpectedInflightException();
+        // 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
+        //   * compilation is faster
+        void handleUnexpectedInflightException() noexcept;
 
         void complete();