From 153965a655fe62841297ed0532edc161d1b3c4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 26 Nov 2021 00:38:13 +0100 Subject: [PATCH] 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. --- 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 - struct MatcherMethod { - virtual bool match(ObjectT const& arg) const = 0; - }; - -#ifdef __clang__ -# pragma clang diagnostic pop -#endif template - struct MatcherBase : MatcherUntypedBase, MatcherMethod {}; + struct MatcherBase : MatcherUntypedBase { + virtual bool match( T const& arg ) const = 0; + }; namespace Detail {