From 350a2ead748027fac358bd8649af95c9ee33572b Mon Sep 17 00:00:00 2001 From: John Bytheway <52664+jbytheway@users.noreply.github.com> Date: Fri, 8 Jul 2022 00:06:29 -0400 Subject: [PATCH] Enable clang-tidy check modernize-use-override (#59039) * Remove unnecessary const * Enable clang-tidy modernize-use-override This ensures that functions which override other functions are explicitly marked as override (or final). --- .clang-tidy | 1 - src/avatar.h | 2 +- src/ui.h | 2 +- tools/clang-tidy-plugin/TranslatorCommentsCheck.h | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 0c5cdd4d51442..c1c8c3bfc2308 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -56,7 +56,6 @@ readability-*,\ -modernize-pass-by-value,\ -modernize-return-braced-init-list,\ -modernize-use-default-member-init,\ --modernize-use-override,\ -performance-no-automatic-move,\ -performance-trivially-destructible,\ -performance-unnecessary-value-param,\ diff --git a/src/avatar.h b/src/avatar.h index a5ea80a0578cc..7bff11e598ec7 100644 --- a/src/avatar.h +++ b/src/avatar.h @@ -76,7 +76,7 @@ class avatar : public Character avatar( const avatar & ) = delete; // NOLINTNEXTLINE(performance-noexcept-move-constructor) avatar( avatar && ); - ~avatar(); + ~avatar() override; avatar &operator=( const avatar & ) = delete; // NOLINTNEXTLINE(performance-noexcept-move-constructor) avatar &operator=( avatar && ); diff --git a/src/ui.h b/src/ui.h index 2d136370e5464..daa6307ec5dde 100644 --- a/src/ui.h +++ b/src/ui.h @@ -383,7 +383,7 @@ class uilist // NOLINT(cata-xy) }; handle_mouse_result_t handle_mouse( const input_context &ctxt, const std::string &ret_act, - const bool loop ); + bool loop ); public: // Parameters diff --git a/tools/clang-tidy-plugin/TranslatorCommentsCheck.h b/tools/clang-tidy-plugin/TranslatorCommentsCheck.h index 1d4f716c3f1bb..f4ffebc4a206d 100644 --- a/tools/clang-tidy-plugin/TranslatorCommentsCheck.h +++ b/tools/clang-tidy-plugin/TranslatorCommentsCheck.h @@ -24,7 +24,7 @@ class TranslatorCommentsCheck : public ClangTidyCheck { public: TranslatorCommentsCheck( StringRef Name, ClangTidyContext *Context ); - ~TranslatorCommentsCheck(); + ~TranslatorCommentsCheck() override; void registerPPCallbacks( const SourceManager &, Preprocessor *, Preprocessor * ) override; void registerMatchers( ast_matchers::MatchFinder *Finder ) override;