Skip to content

Commit

Permalink
Add Wsuggest-override to warning flags
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed May 13, 2020
1 parent ae0ba81 commit 29d4b37
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions CMake/MiscFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
18 changes: 10 additions & 8 deletions src/catch2/internal/catch_clara.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@
#endif
#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH-1

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#pragma clang diagnostic ignored "-Wexit-time-destructors"
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wdeprecated"

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#pragma clang diagnostic ignored "-Wexit-time-destructors"
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wdeprecated"
#endif

#include <catch2/internal/catch_clara_upstream.hpp>

#ifdef __clang__
#pragma clang diagnostic pop
#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
Expand Down
2 changes: 1 addition & 1 deletion src/catch2/internal/catch_clara_upstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/catch2/internal/catch_run_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace Catch {

public:
// !TBD We need to do this another way!
bool aborting() const final;
bool aborting() const override;

private:

Expand Down

0 comments on commit 29d4b37

Please sign in to comment.