diff --git a/src/catch2/internal/catch_assertion_handler.cpp b/src/catch2/internal/catch_assertion_handler.cpp index 5a4806e9..79d5dcd8 100644 --- a/src/catch2/internal/catch_assertion_handler.cpp +++ b/src/catch2/internal/catch_assertion_handler.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -26,7 +27,7 @@ namespace Catch { StringRef capturedExpression, ResultDisposition::Flags resultDisposition ) : m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition }, - m_resultCapture( getResultCapture() ) + m_resultCapture( static_cast(getResultCapture()) ) { m_resultCapture.notifyAssertionStarted( m_assertionInfo ); } diff --git a/src/catch2/internal/catch_assertion_handler.hpp b/src/catch2/internal/catch_assertion_handler.hpp index bc37469d..93a70b1a 100644 --- a/src/catch2/internal/catch_assertion_handler.hpp +++ b/src/catch2/internal/catch_assertion_handler.hpp @@ -15,7 +15,7 @@ namespace Catch { - class IResultCapture; + class RunContext; struct AssertionReaction { bool shouldDebugBreak = false; @@ -27,7 +27,10 @@ namespace Catch { AssertionInfo m_assertionInfo; AssertionReaction m_reaction; bool m_completed = false; - IResultCapture& m_resultCapture; + // Since all uses are hidden in the .cpp file, we can directly use + // the final type and avoid going through virtual dispatch, without + // massive compilation time overhead. + RunContext& m_resultCapture; void finishIncomplete();