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

Delete useless MatcherMethod base class

All of its functionality can be moved into the `MatcherBase` class,
simplifying the code a bit and removing a warning about class with
virtual member functions but no virtual destructor.

Closes #2182 as it is no longer relevant.
Commit
153965a655fe62841297ed0532edc161d1b3c4aa
Author
Martin Hořeňovský ·
Parents
0ac9f4498593

Files · Download .tar.gz

Changes

 src/catch2/matchers/catch_matchers.hpp | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/catch2/matchers/catch_matchers.hpp b/src/catch2/matchers/catch_matchers.hpp
index 86f63bee..7a77a62c 100644
--- a/src/catch2/matchers/catch_matchers.hpp
+++ b/src/catch2/matchers/catch_matchers.hpp
@@ -35,22 +35,11 @@ namespace Matchers {
         mutable std::string m_cachedToString;
     };
 
-#ifdef __clang__
-#    pragma clang diagnostic push
-#    pragma clang diagnostic ignored "-Wnon-virtual-dtor"
-#endif
-
-    template<typename ObjectT>
-    struct MatcherMethod {
-        virtual bool match(ObjectT const& arg) const = 0;
-    };
-
-#ifdef __clang__
-#    pragma clang diagnostic pop
-#endif
 
     template<typename T>
-    struct MatcherBase : MatcherUntypedBase, MatcherMethod<T> {};
+    struct MatcherBase : MatcherUntypedBase {
+        virtual bool match( T const& arg ) const = 0;
+    };
 
     namespace Detail {