Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-09-11 09:41:58 +0200
committerMartin Hořeňovský2026-09-11 11:27:33 +0200
commitb7f1a83ff0c36990a9840bcb3de56a848d24a893 (patch)
tree8742fbcfdfb63543d2faf6c4b21419511f0a7a7c
parent58a5f8bd8c3a40359ed96127ac976f7ddf4b8f01 (diff)
downloadcatch3-b7f1a83ff0c36990a9840bcb3de56a848d24a893.tar.gz
Add some missing CATCH_MOVEs
-rw-r--r--src/catch2/internal/catch_clara.hpp5
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.cpp4
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.hpp1
-rw-r--r--src/catch2/reporters/catch_reporter_helpers.cpp3
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 );
}