Explicitly silence Wnon-virtual-dtor in Decomposer and MatchExpr

Closes #2854
This commit is contained in:
Martin Hořeňovský 2024-04-30 21:08:35 +02:00
parent a654e4b038
commit fa5a53df17
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
3 changed files with 20 additions and 0 deletions

View File

@ -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"

View File

@ -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>)

View File

@ -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;