Supress 'suggest-override' warnings in mocked methods

This commit is contained in:
Alexander Grund 2026-06-23 16:26:30 +02:00
parent 1c168d57fb
commit 90f2b84259
No known key found for this signature in database
GPG key ID: AA48A0760367A42B
2 changed files with 27 additions and 3 deletions

View file

@ -1,7 +1,7 @@
// http://turtle.sourceforge.net
//
// Copyright Mathieu Champlon 2009
// Copyright 2020-2025 Alexander Grund
// Copyright 2020-2026 Alexander Grund
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@ -32,6 +32,27 @@
# endif
#endif
#if defined(__clang__) && defined(__has_warning)
# define MOCK_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
# define MOCK_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
# if __has_warning("-Wsuggest-override")
# define MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE _Pragma("clang diagnostic ignored \"-Wsuggest-override\"")
# endif
#elif defined(__GNUC__)
# define MOCK_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
# define MOCK_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
# if(__GNUC__ >= 9)
# define MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"")
# endif
#endif
#ifndef MOCK_DIAGNOSTIC_PUSH
# define MOCK_DIAGNOSTIC_PUSH
# define MOCK_DIAGNOSTIC_POP
#endif
#ifndef MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE
# define MOCK_DIAGNOSTIC_IGNORE_SUGGEST_OVERRIDE
#endif
#if BOOST_VERSION >= 107700
# define MOCK_CXX_VERSION BOOST_CXX_VERSION
#elif defined(_MSC_VER)