diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/src/catch2/reporters/catch_reporter_cumulative_base.cpp index dcb57fc2..b4824148 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -58,8 +58,9 @@ namespace Catch { node = *it; } } - m_sectionStack.push_back( node ); - m_deepestSection = std::move( node ); + + m_deepestSection = node.get(); + m_sectionStack.push_back( std::move(node) ); } bool CumulativeReporterBase::assertionEnded( diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp index 8897523e..dc50a98a 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp @@ -81,7 +81,7 @@ namespace Catch { std::vector> m_testRuns; std::shared_ptr m_rootSection; - std::shared_ptr m_deepestSection; + SectionNode* m_deepestSection = nullptr; std::vector> m_sectionStack; };