enabled and fixed `performance-noexcept-move-constructor` clang-tidy warnings (#4864)

This commit is contained in:
Oliver Stöneberg 2023-03-07 12:24:01 +01:00 committed by GitHub
parent 20db3ff368
commit 63f439dc1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,5 @@
--- ---
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics,-misc-use-anonymous-namespace' Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics,-misc-use-anonymous-namespace'
WarningsAsErrors: '*' WarningsAsErrors: '*'
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h' HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
CheckOptions: CheckOptions:

View File

@ -135,7 +135,7 @@ Also reports a false positive about templates which deduce the array length: htt
`misc-throw-by-value-catch-by-reference`<br> `misc-throw-by-value-catch-by-reference`<br>
`readability-avoid-const-params-in-decls`<br> `readability-avoid-const-params-in-decls`<br>
`bugprone-signed-char-misuse`<br> `bugprone-signed-char-misuse`<br>
`performance-noexcept-move-constructor`<br> `readability-redundant-access-specifiers`<br>
`concurrency-mt-unsafe`<br> `concurrency-mt-unsafe`<br>
`misc-use-anonymous-namespace`<br> `misc-use-anonymous-namespace`<br>

View File

@ -233,7 +233,7 @@ TemplateSimplifier::TokenAndName::TokenAndName(const TokenAndName& other) :
mToken->templateSimplifierPointer(this); mToken->templateSimplifierPointer(this);
} }
TemplateSimplifier::TokenAndName::TokenAndName(TokenAndName&& other) : TemplateSimplifier::TokenAndName::TokenAndName(TokenAndName&& other) NOEXCEPT :
mToken(other.mToken), mScope(std::move(other.mScope)), mName(std::move(other.mName)), mFullName(std::move(other.mFullName)), mToken(other.mToken), mScope(std::move(other.mScope)), mName(std::move(other.mName)), mFullName(std::move(other.mFullName)),
mNameToken(other.mNameToken), mParamEnd(other.mParamEnd), mFlags(other.mFlags) mNameToken(other.mNameToken), mParamEnd(other.mParamEnd), mFlags(other.mFlags)
{ {

View File

@ -148,7 +148,7 @@ public:
*/ */
TokenAndName(Token *token, std::string scope, const Token *nameToken, const Token *paramEnd); TokenAndName(Token *token, std::string scope, const Token *nameToken, const Token *paramEnd);
TokenAndName(const TokenAndName& other); TokenAndName(const TokenAndName& other);
TokenAndName(TokenAndName&& other); TokenAndName(TokenAndName&& other) NOEXCEPT;
~TokenAndName(); ~TokenAndName();
bool operator == (const TokenAndName & rhs) const { bool operator == (const TokenAndName & rhs) const {

View File

@ -22,6 +22,7 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#include "config.h" #include "config.h"
#include <memory> #include <memory>
template<class T> template<class T>
@ -51,7 +52,7 @@ public:
mPtr.reset(mClone(rhs.get())); mPtr.reset(mClone(rhs.get()));
} }
} }
ValuePtr(ValuePtr&& rhs) : mPtr(std::move(rhs.mPtr)), mClone(std::move(rhs.mClone)) {} ValuePtr(ValuePtr&& rhs) NOEXCEPT : mPtr(std::move(rhs.mPtr)), mClone(std::move(rhs.mClone)) {}
/** /**
* Releases the shared_ptr's ownership of the managed object using the .reset() function * Releases the shared_ptr's ownership of the managed object using the .reset() function