Skip to content

Commit 32095ff

Browse files
committed
enabled and fixed performance-noexcept-move-constructor clang-tidy warnings
1 parent d381ec2 commit 32095ff

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
@@ -45,8 +45,7 @@ Checks: >
4545
-readability-uppercase-literal-suffix,
4646
-performance-avoid-endl,
4747
-performance-inefficient-string-concatenation,
48-
-performance-no-automatic-move,
49-
-performance-noexcept-move-constructor
48+
-performance-no-automatic-move
5049
HeaderFilterRegex: '.*'
5150
WarningsAsErrors: '*'
5251
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
@@ -270,10 +270,10 @@ namespace simplecpp {
270270
/** generates a token list from the given filename parameter */
271271
TokenList(const std::string &filename, std::vector<std::string> &filenames, OutputList *outputList = nullptr);
272272
TokenList(const TokenList &other);
273-
TokenList(TokenList &&other);
273+
TokenList(TokenList &&other) noexcept;
274274
~TokenList();
275275
TokenList &operator=(const TokenList &other);
276-
TokenList &operator=(TokenList &&other);
276+
TokenList &operator=(TokenList &&other) noexcept;
277277

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

0 commit comments

Comments
 (0)