diff --git a/.clang-tidy b/.clang-tidy
index 0b130f31de0..d5054062dac 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 f54363c9342..dce24786dcb 100644
--- a/clang-tidy.md
+++ b/clang-tidy.md
@@ -125,7 +125,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 33e4352d958..a8909b8c212 100644
--- a/cli/cmdlineparser.h
+++ b/cli/cmdlineparser.h
@@ -20,6 +20,7 @@
#define CMDLINE_PARSER_H
#include
+#include
#include
#include
#include
@@ -55,7 +56,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 edee1632432..eaba040ae8f 100644
--- a/cli/processexecutor.cpp
+++ b/cli/processexecutor.cpp
@@ -57,7 +57,7 @@
#include
#endif
-enum class Color;
+enum class Color : std::uint8_t;
// NOLINTNEXTLINE(misc-unused-using-decls) - required for FD_ZERO
using std::memset;
@@ -73,7 +73,7 @@ ProcessExecutor::ProcessExecutor(const std::list &files, const
namespace {
class PipeWriter : public ErrorLogger {
public:
- enum PipeSignal {REPORT_OUT='1',REPORT_ERROR='2', CHILD_END='5'};
+ enum PipeSignal : std::uint8_t {REPORT_OUT='1',REPORT_ERROR='2', CHILD_END='5'};
explicit PipeWriter(int pipe) : mWpipe(pipe) {}
diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp
index 2c0ffe31bc4..5d4d3a760e6 100644
--- a/cli/threadexecutor.cpp
+++ b/cli/threadexecutor.cpp
@@ -38,7 +38,7 @@
#include
#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 67e2eabe5e3..0d2ffbfea83 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 7fb7a5f1068..94ab3340367 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 2ccf9d93ba3..a442780c3c2 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 61be78af194..37005e1ccd0 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 af12621d4d4..40f5e87f14c 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 6da0e491196..2bc8752ca80 100644
--- a/gui/projectfile.h
+++ b/gui/projectfile.h
@@ -23,6 +23,7 @@
#include "suppressions.h"
#include
+#include
#include