From 5ad8ca791c0498fb39e21d07b3c0e856b3e7677b Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 8 Jan 2023 14:32:52 +0100 Subject: [PATCH] Fix various small warnings (#4296) * Fix `inconsistent-missing-override` warnings * Fix `final-dtor-non-final-class` warnings * Fix `ambiguous-reversed-operator` warnings --- CHANGELOG.md | 3 +++ src/CMakeLists.txt | 4 ++++ src/common/FlagsEnum.hpp | 4 ++-- src/widgets/dialogs/ColorPickerDialog.hpp | 4 ++-- src/widgets/dialogs/EditHotkeyDialog.hpp | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b82f85308..f775be91d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ - Dev: Removed unused operators in `Image` (#4267) - Dev: Removed usage of deprecated `QDesktopWidget` (#4287) - Dev: Bump Cirrus CI FreeBSD image from 12.1 to 13.1. (#4295) +- Dev: Fixed `inconsistent-missing-override` warnings. (#4296) +- Dev: Fixed `final-dtor-non-final-class` warnings. (#4296) +- Dev: Fixed `ambiguous-reversed-operator` warnings. (#4296) ## 2.4.0 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eebd4c246..5841a7754 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -846,6 +846,10 @@ else () target_compile_options(${LIBRARY_PROJECT} PUBLIC -Wno-unused-local-typedef -Wno-unused-private-field + -Werror=inconsistent-missing-override + -Werror=final-dtor-non-final-class + -Werror=ambiguous-reversed-operator + ) else () target_compile_options(${LIBRARY_PROJECT} PUBLIC diff --git a/src/common/FlagsEnum.hpp b/src/common/FlagsEnum.hpp index da3093015..5eee93879 100644 --- a/src/common/FlagsEnum.hpp +++ b/src/common/FlagsEnum.hpp @@ -27,12 +27,12 @@ public: } } - bool operator==(const FlagsEnum &other) + bool operator==(const FlagsEnum &other) const { return this->value_ == other.value_; } - bool operator!=(const FlagsEnum &other) + bool operator!=(const FlagsEnum &other) const { return this->value_ != other.value_; } diff --git a/src/widgets/dialogs/ColorPickerDialog.hpp b/src/widgets/dialogs/ColorPickerDialog.hpp index 132e6ac0d..71b44604e 100644 --- a/src/widgets/dialogs/ColorPickerDialog.hpp +++ b/src/widgets/dialogs/ColorPickerDialog.hpp @@ -53,8 +53,8 @@ public: pajlada::Signals::Signal closed; protected: - void closeEvent(QCloseEvent *); - void themeChangedEvent(); + void closeEvent(QCloseEvent *) override; + void themeChangedEvent() override; private: struct { diff --git a/src/widgets/dialogs/EditHotkeyDialog.hpp b/src/widgets/dialogs/EditHotkeyDialog.hpp index e442b4f6d..d2c1f5e85 100644 --- a/src/widgets/dialogs/EditHotkeyDialog.hpp +++ b/src/widgets/dialogs/EditHotkeyDialog.hpp @@ -14,7 +14,7 @@ namespace chatterino { class Hotkey; -class EditHotkeyDialog : public QDialog +class EditHotkeyDialog final : public QDialog { Q_OBJECT