From ed2d4e41d595e76f5288b2c14375391d4b046b4a Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 1 Sep 2025 08:06:05 +0200 Subject: [PATCH] enabled and fixed `modernize-use-equals-default` clang-tidy warnings --- .clang-tidy | 1 - simplecpp.cpp | 2 +- simplecpp.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index b88a3d36..183e78c0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -31,7 +31,6 @@ Checks: > -modernize-pass-by-value, -modernize-return-braced-init-list, -modernize-use-auto, - -modernize-use-equals-default, -modernize-use-equals-delete, -modernize-use-default-member-init, -modernize-use-nodiscard, diff --git a/simplecpp.cpp b/simplecpp.cpp index d37c0aa7..1ceabbed 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -240,7 +240,7 @@ void simplecpp::Token::printOut() const // cppcheck-suppress noConstructor - we call init() in the inherited to initialize the private members class simplecpp::TokenList::Stream { public: - virtual ~Stream() {} + virtual ~Stream() = default; virtual int get() = 0; virtual int peek() = 0; diff --git a/simplecpp.h b/simplecpp.h index 78609af3..98a78f1c 100644 --- a/simplecpp.h +++ b/simplecpp.h @@ -79,7 +79,7 @@ namespace simplecpp { public: explicit Location(const std::vector &f) : files(f), fileIndex(0), line(1U), col(0U) {} - Location(const Location &loc) : files(loc.files), fileIndex(loc.fileIndex), line(loc.line), col(loc.col) {} + Location(const Location &loc) = default; Location &operator=(const Location &other) { if (this != &other) {