From 51fda48c603104e1faa57b6df3e1bf6fae82f627 Mon Sep 17 00:00:00 2001 From: PowellNGL Date: Tue, 21 Apr 2026 14:43:43 +0200 Subject: [PATCH] Allow matchers to be used in constexpr code --- src/catch2/matchers/catch_matchers.cpp | 2 -- src/catch2/matchers/catch_matchers.hpp | 2 +- src/catch2/matchers/catch_matchers_templated.cpp | 2 -- src/catch2/matchers/catch_matchers_templated.hpp | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/catch2/matchers/catch_matchers.cpp b/src/catch2/matchers/catch_matchers.cpp index 123b30413d..c5d8f27838 100644 --- a/src/catch2/matchers/catch_matchers.cpp +++ b/src/catch2/matchers/catch_matchers.cpp @@ -19,7 +19,5 @@ namespace Matchers { return m_cachedToString; } - MatcherUntypedBase::~MatcherUntypedBase() = default; - } // namespace Matchers } // namespace Catch diff --git a/src/catch2/matchers/catch_matchers.hpp b/src/catch2/matchers/catch_matchers.hpp index 90ed333854..d96ac0cb73 100644 --- a/src/catch2/matchers/catch_matchers.hpp +++ b/src/catch2/matchers/catch_matchers.hpp @@ -31,7 +31,7 @@ namespace Matchers { std::string toString() const; protected: - virtual ~MatcherUntypedBase(); // = default; + virtual ~MatcherUntypedBase() = default; virtual std::string describe() const = 0; mutable std::string m_cachedToString; }; diff --git a/src/catch2/matchers/catch_matchers_templated.cpp b/src/catch2/matchers/catch_matchers_templated.cpp index 2fc529d2b9..0547869b1a 100644 --- a/src/catch2/matchers/catch_matchers_templated.cpp +++ b/src/catch2/matchers/catch_matchers_templated.cpp @@ -9,8 +9,6 @@ namespace Catch { namespace Matchers { - MatcherGenericBase::~MatcherGenericBase() = default; - namespace Detail { std::string describe_multi_matcher(StringRef combine, std::string const* descriptions_begin, std::string const* descriptions_end) { diff --git a/src/catch2/matchers/catch_matchers_templated.hpp b/src/catch2/matchers/catch_matchers_templated.hpp index 0cd4016365..8c33ca5fd3 100644 --- a/src/catch2/matchers/catch_matchers_templated.hpp +++ b/src/catch2/matchers/catch_matchers_templated.hpp @@ -24,7 +24,7 @@ namespace Matchers { class MatcherGenericBase : public MatcherUntypedBase { public: MatcherGenericBase() = default; - ~MatcherGenericBase() override; // = default; + ~MatcherGenericBase() override = default; MatcherGenericBase(MatcherGenericBase const&) = default; MatcherGenericBase(MatcherGenericBase&&) = default;