diff --git a/.clang-tidy b/.clang-tidy index b63cb3d9..9523e73f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -45,8 +45,7 @@ Checks: > -readability-uppercase-literal-suffix, -performance-avoid-endl, -performance-inefficient-string-concatenation, - -performance-no-automatic-move, - -performance-noexcept-move-constructor + -performance-no-automatic-move HeaderFilterRegex: '.*' WarningsAsErrors: '*' CheckOptions: diff --git a/simplecpp.cpp b/simplecpp.cpp index 7d306fd7..24ff9f7c 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -499,7 +499,7 @@ simplecpp::TokenList::TokenList(const TokenList &other) : frontToken(nullptr), b *this = other; } -simplecpp::TokenList::TokenList(TokenList &&other) : frontToken(nullptr), backToken(nullptr), files(other.files) +simplecpp::TokenList::TokenList(TokenList &&other) noexcept : frontToken(nullptr), backToken(nullptr), files(other.files) { *this = std::move(other); } @@ -521,7 +521,7 @@ simplecpp::TokenList &simplecpp::TokenList::operator=(const TokenList &other) return *this; } -simplecpp::TokenList &simplecpp::TokenList::operator=(TokenList &&other) +simplecpp::TokenList &simplecpp::TokenList::operator=(TokenList &&other) noexcept { if (this != &other) { clear(); diff --git a/simplecpp.h b/simplecpp.h index 22f3c19f..6cc9d2c9 100644 --- a/simplecpp.h +++ b/simplecpp.h @@ -270,10 +270,10 @@ namespace simplecpp { /** generates a token list from the given filename parameter */ TokenList(const std::string &filename, std::vector &filenames, OutputList *outputList = nullptr); TokenList(const TokenList &other); - TokenList(TokenList &&other); + TokenList(TokenList &&other) noexcept; ~TokenList(); TokenList &operator=(const TokenList &other); - TokenList &operator=(TokenList &&other); + TokenList &operator=(TokenList &&other) noexcept; void clear(); bool empty() const {