From: Rosen Penev Date: Tue, 5 Dec 2023 00:27:43 +0000 (-0800) Subject: clang-tidy: add noexcept for move stuff X-Git-Tag: dnsdist-1.9.0-rc1~34^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71633799e96b771c96df7549639eca134fd1f9e1;p=thirdparty%2Fpdns.git clang-tidy: add noexcept for move stuff Found with performance-noexcept-move-constructor --- diff --git a/pdns/credentials.cc b/pdns/credentials.cc index 5038804b63..ec11732f24 100644 --- a/pdns/credentials.cc +++ b/pdns/credentials.cc @@ -69,7 +69,7 @@ SensitiveData::SensitiveData(std::string&& data) : #endif } -SensitiveData& SensitiveData::operator=(SensitiveData&& rhs) +SensitiveData& SensitiveData::operator=(SensitiveData&& rhs) noexcept { d_data = std::move(rhs.d_data); rhs.clear(); diff --git a/pdns/credentials.hh b/pdns/credentials.hh index 6e59c6b40e..6762b1a845 100644 --- a/pdns/credentials.hh +++ b/pdns/credentials.hh @@ -29,7 +29,7 @@ class SensitiveData public: SensitiveData(size_t bytes); SensitiveData(std::string&& data); - SensitiveData& operator=(SensitiveData&&); + SensitiveData& operator=(SensitiveData&&) noexcept; ~SensitiveData(); void clear(); diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index 101d17464c..034e3d4f1b 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -89,7 +89,7 @@ public: } return *this; } - DNSName& operator=(DNSName&& rhs) + DNSName& operator=(DNSName&& rhs) noexcept { if (this != &rhs) { d_storage = std::move(rhs.d_storage); diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index f61d915266..f674dd4da9 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -638,7 +638,8 @@ public: return *this; } - NSECBitmap(NSECBitmap&& rhs): d_bitset(std::move(rhs.d_bitset)), d_set(std::move(rhs.d_set)) + NSECBitmap(NSECBitmap&& rhs) noexcept : + d_bitset(std::move(rhs.d_bitset)), d_set(std::move(rhs.d_set)) { } bool isSet(uint16_t type) const diff --git a/pdns/iputils.hh b/pdns/iputils.hh index ee2f8f04f2..7e6a392105 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -1288,7 +1288,8 @@ public: } //