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

Add some missing CATCH_MOVEs

Commit
b7f1a83ff0c36990a9840bcb3de56a848d24a893
Author
Martin Hořeňovský ·
Parents
58a5f8bd8c3a

Files · Download .tar.gz

Changes

 src/catch2/internal/catch_clara.hpp                     | 5 +++--
 src/catch2/reporters/catch_reporter_cumulative_base.cpp | 4 ++--
 src/catch2/reporters/catch_reporter_cumulative_base.hpp | 1 +
 src/catch2/reporters/catch_reporter_helpers.cpp         | 3 ++-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/catch2/internal/catch_clara.hpp b/src/catch2/internal/catch_clara.hpp
index 85874a15..ef297947 100644
--- a/src/catch2/internal/catch_clara.hpp
+++ b/src/catch2/internal/catch_clara.hpp
@@ -377,8 +377,9 @@ namespace Catch {
                     -> ParserResult override {
                     T temp;
                     auto result = convertInto( arg, temp );
-                    if ( result )
-                        m_ref.push_back( temp );
+                    if ( result ) {
+                        m_ref.push_back( CATCH_MOVE( temp ) );
+                    }
                     return result;
                 }
             };
diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/src/catch2/reporters/catch_reporter_cumulative_base.cpp
index dc5ae4b0..c4c4159f 100644
--- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp
+++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp
@@ -74,7 +74,7 @@ namespace Catch {
         if ( m_sectionStack.empty() ) {
             if ( !m_rootSection ) {
                 m_rootSection =
-                    Detail::make_unique<SectionNode>( incompleteStats );
+                    Detail::make_unique<SectionNode>( CATCH_MOVE( incompleteStats ) );
             }
             node = m_rootSection.get();
         } else {
@@ -84,7 +84,7 @@ namespace Catch {
                                     BySectionInfo( sectionInfo ) );
             if ( it == parentNode.childSections.end() ) {
                 auto newNode =
-                    Detail::make_unique<SectionNode>( incompleteStats );
+                    Detail::make_unique<SectionNode>( CATCH_MOVE( incompleteStats ) );
                 node = newNode.get();
                 parentNode.childSections.push_back( CATCH_MOVE( newNode ) );
             } else {
diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp
index 267b39fd..3a2eb793 100644
--- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp
+++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp
@@ -71,6 +71,7 @@ namespace Catch {
         };
         struct SectionNode {
             explicit SectionNode(SectionStats const& _stats) : stats(_stats) {}
+            explicit SectionNode(SectionStats&& _stats) : stats(CATCH_MOVE(_stats)) {}
 
             bool operator == (SectionNode const& other) const {
                 return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
diff --git a/src/catch2/reporters/catch_reporter_helpers.cpp b/src/catch2/reporters/catch_reporter_helpers.cpp
index 0044efb5..cfb2219d 100644
--- a/src/catch2/reporters/catch_reporter_helpers.cpp
+++ b/src/catch2/reporters/catch_reporter_helpers.cpp
@@ -14,6 +14,7 @@
 #include <catch2/internal/catch_reusable_string_stream.hpp>
 #include <catch2/internal/catch_string_manip.hpp>
 #include <catch2/internal/catch_console_colour.hpp>
+#include <catch2/internal/catch_move_and_forward.hpp>
 #include <catch2/catch_tostring.hpp>
 #include <catch2/catch_test_case_info.hpp>
 
@@ -288,7 +289,7 @@ namespace Catch {
                     row.insert( 0, m_width - row.size(), ' ' );
                 }
                 m_width = new_width;
-                m_rows.push_back( row );
+                m_rows.push_back( CATCH_MOVE( row ) );
                 return std::move( *this );
             }