mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +01:00 
			
		
		
		
	Explicitly silence Wnon-virtual-dtor in Decomposer and MatchExpr
Closes #2854
This commit is contained in:
		@@ -68,6 +68,7 @@ function(add_warnings_to_targets targets)
 | 
			
		||||
          "-Wmissing-noreturn"
 | 
			
		||||
          "-Wmissing-prototypes"
 | 
			
		||||
          "-Wmissing-variable-declarations"
 | 
			
		||||
          "-Wnon-virtual-dtor"
 | 
			
		||||
          "-Wnull-dereference"
 | 
			
		||||
          "-Wold-style-cast"
 | 
			
		||||
          "-Woverloaded-virtual"
 | 
			
		||||
 
 | 
			
		||||
@@ -110,9 +110,11 @@
 | 
			
		||||
#ifdef __clang__
 | 
			
		||||
#  pragma clang diagnostic push
 | 
			
		||||
#  pragma clang diagnostic ignored "-Wsign-compare"
 | 
			
		||||
#  pragma clang diagnostic ignored "-Wnon-virtual-dtor"
 | 
			
		||||
#elif defined __GNUC__
 | 
			
		||||
#  pragma GCC diagnostic push
 | 
			
		||||
#  pragma GCC diagnostic ignored "-Wsign-compare"
 | 
			
		||||
#  pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CATCH_CPP20_OR_GREATER) && __has_include(<compare>)
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,16 @@
 | 
			
		||||
 | 
			
		||||
namespace Catch {
 | 
			
		||||
 | 
			
		||||
#ifdef __clang__
 | 
			
		||||
#    pragma clang diagnostic push
 | 
			
		||||
#    pragma clang diagnostic ignored "-Wsign-compare"
 | 
			
		||||
#    pragma clang diagnostic ignored "-Wnon-virtual-dtor"
 | 
			
		||||
#elif defined __GNUC__
 | 
			
		||||
#    pragma GCC diagnostic push
 | 
			
		||||
#    pragma GCC diagnostic ignored "-Wsign-compare"
 | 
			
		||||
#    pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    template<typename ArgT, typename MatcherT>
 | 
			
		||||
    class MatchExpr : public ITransientExpression {
 | 
			
		||||
        ArgT && m_arg;
 | 
			
		||||
@@ -36,6 +46,13 @@ namespace Catch {
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
#ifdef __clang__
 | 
			
		||||
#    pragma clang diagnostic pop
 | 
			
		||||
#elif defined __GNUC__
 | 
			
		||||
#    pragma GCC diagnostic pop
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    namespace Matchers {
 | 
			
		||||
        template <typename ArgT>
 | 
			
		||||
        class MatcherBase;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user