diff --git a/.clang-tidy b/.clang-tidy
index 0b130f31de08..d5054062dacc 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -51,7 +51,6 @@ Checks: >
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-performance-avoid-endl,
- -performance-enum-size,
-performance-inefficient-string-concatenation,
-performance-no-automatic-move,
-performance-noexcept-swap,
diff --git a/clang-tidy.md b/clang-tidy.md
index 108af31a354e..3cdfcbf9510a 100644
--- a/clang-tidy.md
+++ b/clang-tidy.md
@@ -129,7 +129,6 @@ We run this separately via `clang-include-cleaner` in the `iwyu.yml` workflow as
`performance-noexcept-swap`
`bugprone-switch-missing-default-case`
`bugprone-empty-catch`
-`performance-enum-size`
`readability-avoid-nested-conditional-operator`
To be evaluated (need to remove exclusion).
diff --git a/cli/cmdlineparser.h b/cli/cmdlineparser.h
index 4e41094ee101..607608de6cf0 100644
--- a/cli/cmdlineparser.h
+++ b/cli/cmdlineparser.h
@@ -20,6 +20,7 @@
#define CMDLINE_PARSER_H
#include
+#include
#include
#include
#include
@@ -56,7 +57,7 @@ class CmdLineParser {
*/
CmdLineParser(CmdLineLogger &logger, Settings &settings, Suppressions &suppressions);
- enum class Result { Success, Exit, Fail };
+ enum class Result : std::uint8_t { Success, Exit, Fail };
/**
* @brief Parse command line args and fill settings and file lists
diff --git a/cli/processexecutor.cpp b/cli/processexecutor.cpp
index de847015ded1..0194fc55f4a9 100644
--- a/cli/processexecutor.cpp
+++ b/cli/processexecutor.cpp
@@ -56,7 +56,7 @@
#include
#endif
-enum class Color;
+enum class Color : std::uint8_t ;
// NOLINTNEXTLINE(misc-unused-using-decls) - required for FD_ZERO
using std::memset;
@@ -72,7 +72,7 @@ ProcessExecutor::ProcessExecutor(const std::list
#include
-enum class Color;
+enum class Color : std::uint8_t ;
ThreadExecutor::ThreadExecutor(const std::list> &files, const std::list& fileSettings, const Settings &settings, SuppressionList &suppressions, ErrorLogger &errorLogger, CppCheck::ExecuteCmdFn executeCommand)
: Executor(files, fileSettings, settings, suppressions, errorLogger)
diff --git a/gui/checkthread.h b/gui/checkthread.h
index 2b415bef6c51..21fe3b3da8c1 100644
--- a/gui/checkthread.h
+++ b/gui/checkthread.h
@@ -24,6 +24,7 @@
#include "suppressions.h"
#include
+#include
#include
#include
@@ -115,7 +116,7 @@ class CheckThread : public QThread {
* has been completed. Thread must be stopped cleanly, just terminating thread
* likely causes unpredictable side-effects.
*/
- enum State {
+ enum State : std::uint8_t {
Running, /**< The thread is checking. */
Stopping, /**< The thread will stop after current work. */
Stopped, /**< The thread has been stopped. */
diff --git a/gui/codeeditor.h b/gui/codeeditor.h
index 6e06db9881f1..f627d8b4a795 100644
--- a/gui/codeeditor.h
+++ b/gui/codeeditor.h
@@ -19,6 +19,8 @@
#ifndef CODEEDITOR_H
#define CODEEDITOR_H
+#include
+
#include
#include
#include
@@ -51,7 +53,7 @@ class Highlighter : public QSyntaxHighlighter {
void highlightBlock(const QString &text) override;
private:
- enum RuleRole {
+ enum RuleRole : std::uint8_t {
Keyword = 1,
Class = 2,
Comment = 3,
diff --git a/gui/cppchecklibrarydata.h b/gui/cppchecklibrarydata.h
index 2ccf9d93ba30..a442780c3c2c 100644
--- a/gui/cppchecklibrarydata.h
+++ b/gui/cppchecklibrarydata.h
@@ -19,6 +19,8 @@
#ifndef CPPCHECKLIBRARYDATA_H
#define CPPCHECKLIBRARYDATA_H
+#include
+
#include
#include
#include
@@ -72,7 +74,7 @@ class CppcheckLibraryData {
struct Function {
QString comments;
QString name;
- enum TrueFalseUnknown { False, True, Unknown } noreturn = Unknown;
+ enum TrueFalseUnknown : std::uint8_t { False, True, Unknown } noreturn = Unknown;
bool gccPure{};
bool gccConst{};
bool leakignore{};
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 5214b690ddca..7b3b164a9b0b 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -22,6 +22,8 @@
#include "library.h"
#include "platforms.h"
+#include
+
#include
#include
#include
@@ -62,7 +64,7 @@ class MainWindow : public QMainWindow {
/**
* @brief Maximum number of MRU project items in File-menu.
*/
- enum { MaxRecentProjects = 5 };
+ enum : std::uint8_t { MaxRecentProjects = 5 };
MainWindow(TranslationHandler* th, QSettings* settings);
MainWindow(const MainWindow &) = delete;
diff --git a/gui/newsuppressiondialog.cpp b/gui/newsuppressiondialog.cpp
index 8635fc0ef0c1..7bd97431a848 100644
--- a/gui/newsuppressiondialog.cpp
+++ b/gui/newsuppressiondialog.cpp
@@ -31,7 +31,7 @@
#include
class QWidget;
-enum class Color;
+enum class Color : std::uint8_t ;
NewSuppressionDialog::NewSuppressionDialog(QWidget *parent) :
QDialog(parent),
diff --git a/gui/projectfile.h b/gui/projectfile.h
index df4d94fbbaa3..9e263e656495 100644
--- a/gui/projectfile.h
+++ b/gui/projectfile.h
@@ -23,6 +23,7 @@
#include "suppressions.h"
#include
+#include
#include