Add Wsuggest-override to warning flags

This commit is contained in:
Martin Hořeňovský 2020-05-13 13:15:37 +02:00
parent ae0ba81423
commit 29d4b3768c
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
4 changed files with 13 additions and 10 deletions

View File

@ -61,6 +61,7 @@ function(add_warnings_to_targets targets)
"-Wunused-function"
"-Wcall-to-pure-virtual-from-ctor-dtor"
"-Wdeprecated-register"
"-Wsuggest-override"
)
foreach(warning ${CHECKED_WARNING_FLAGS})
add_cxx_flag_if_supported_to_targets(${warning} "${targets}")

View File

@ -16,7 +16,8 @@
#endif
#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH-1
#ifdef __clang__
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#pragma clang diagnostic ignored "-Wexit-time-destructors"
@ -26,10 +27,11 @@
#include <catch2/internal/catch_clara_upstream.hpp>
#ifdef __clang__
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
// Restore Clara's value for console width, if present
#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH

View File

@ -705,7 +705,7 @@ namespace detail {
};
struct BoundFlagRefBase : BoundRef {
virtual auto setFlag( bool flag ) -> ParserResult = 0;
virtual auto isFlag() const -> bool { return true; }
bool isFlag() const override { return true; }
};
template<typename T>

View File

@ -105,7 +105,7 @@ namespace Catch {
public:
// !TBD We need to do this another way!
bool aborting() const final;
bool aborting() const override;
private: