Skip to content

Commit 6f453b8

Browse files
committed
enabled and fixed performance-noexcept-move-constructor clang-tidy warnings
1 parent cb9a9a2 commit 6f453b8

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

.clang-tidy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ Checks: >
4747
-readability-uppercase-literal-suffix,
4848
-performance-avoid-endl,
4949
-performance-inefficient-string-concatenation,
50-
-performance-no-automatic-move,
51-
-performance-noexcept-move-constructor
50+
-performance-no-automatic-move
5251
HeaderFilterRegex: '.*'
5352
WarningsAsErrors: '*'
5453
CheckOptions:

simplecpp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ simplecpp::TokenList::TokenList(const TokenList &other) : frontToken(nullptr), b
499499
*this = other;
500500
}
501501

502-
simplecpp::TokenList::TokenList(TokenList &&other) : frontToken(nullptr), backToken(nullptr), files(other.files)
502+
simplecpp::TokenList::TokenList(TokenList &&other) noexcept : frontToken(nullptr), backToken(nullptr), files(other.files)
503503
{
504504
*this = std::move(other);
505505
}
@@ -521,7 +521,7 @@ simplecpp::TokenList &simplecpp::TokenList::operator=(const TokenList &other)
521521
return *this;
522522
}
523523

524-
simplecpp::TokenList &simplecpp::TokenList::operator=(TokenList &&other)
524+
simplecpp::TokenList &simplecpp::TokenList::operator=(TokenList &&other) noexcept
525525
{
526526
if (this != &other) {
527527
clear();

simplecpp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,10 @@ namespace simplecpp {
271271
/** generates a token list from the given filename parameter */
272272
TokenList(const std::string &filename, std::vector<std::string> &filenames, OutputList *outputList = nullptr);
273273
TokenList(const TokenList &other);
274-
TokenList(TokenList &&other);
274+
TokenList(TokenList &&other) noexcept;
275275
~TokenList();
276276
TokenList &operator=(const TokenList &other);
277-
TokenList &operator=(TokenList &&other);
277+
TokenList &operator=(TokenList &&other) noexcept;
278278

279279
void clear();
280280
bool empty() const {

0 commit comments

Comments
 (0)