From f15cab4a2b4835abfe210a716361d7efce1a1087 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Tue, 10 Jun 2025 09:57:26 -0700 Subject: [PATCH] Fix clang-tidy modernize-use-equals-delete warnings in headers --- src/OpaqueVal.h | 8 ++++---- src/SmithWaterman.h | 4 ++-- src/input/ReaderBackend.h | 3 +-- src/logging/WriterBackend.h | 3 +-- src/probabilistic/CounterVector.h | 4 ++-- src/spicy/cookie.h | 6 +++--- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/OpaqueVal.h b/src/OpaqueVal.h index a1ad234eae..1b0294dd23 100644 --- a/src/OpaqueVal.h +++ b/src/OpaqueVal.h @@ -328,6 +328,10 @@ public: explicit BloomFilterVal(probabilistic::BloomFilter* bf); ~BloomFilterVal() override; + // Disable. + BloomFilterVal(const BloomFilterVal&) = delete; + BloomFilterVal& operator=(const BloomFilterVal&) = delete; + ValPtr DoClone(CloneState* state) override; const TypePtr& Type() const { return type; } @@ -350,10 +354,6 @@ protected: DECLARE_OPAQUE_VALUE_DATA(BloomFilterVal) private: - // Disable. - BloomFilterVal(const BloomFilterVal&); - BloomFilterVal& operator=(const BloomFilterVal&); - TypePtr type; detail::CompositeHash* hash; probabilistic::BloomFilter* bloom_filter; diff --git a/src/SmithWaterman.h b/src/SmithWaterman.h index 1a6d13ac57..2eeb1c7bd5 100644 --- a/src/SmithWaterman.h +++ b/src/SmithWaterman.h @@ -40,6 +40,8 @@ public: using BSSAlignVec = std::vector; + Substring() = delete; + explicit Substring(const std::string& string) : String(string), _num(), _new(false) {} explicit Substring(const String& string) : String(string), _num(), _new(false) {} @@ -75,8 +77,6 @@ public: private: using DataMap = std::map; - Substring(); - // The alignments registered for this substring. BSSAlignVec _aligns; diff --git a/src/input/ReaderBackend.h b/src/input/ReaderBackend.h index 6e889ad0ef..29ec4761fb 100644 --- a/src/input/ReaderBackend.h +++ b/src/input/ReaderBackend.h @@ -132,8 +132,7 @@ public: } } - private: - const ReaderInfo& operator=(const ReaderInfo& other); // Disable. + const ReaderInfo& operator=(const ReaderInfo& other) = delete; }; /** diff --git a/src/logging/WriterBackend.h b/src/logging/WriterBackend.h index 8c53ceb54a..49cd8a713b 100644 --- a/src/logging/WriterBackend.h +++ b/src/logging/WriterBackend.h @@ -127,8 +127,7 @@ public: broker::data ToBroker() const; bool FromBroker(broker::data d); - private: - const WriterInfo& operator=(const WriterInfo& other); // Disable. + const WriterInfo& operator=(const WriterInfo& other) = delete; }; /** diff --git a/src/probabilistic/CounterVector.h b/src/probabilistic/CounterVector.h index a63285a7ba..7732a58a93 100644 --- a/src/probabilistic/CounterVector.h +++ b/src/probabilistic/CounterVector.h @@ -47,6 +47,8 @@ public: */ virtual ~CounterVector(); + CounterVector& operator=(const CounterVector&) = delete; + /** * Increments a given cell. * @@ -157,8 +159,6 @@ protected: CounterVector() = default; private: - CounterVector& operator=(const CounterVector&); // Disable. - BitVector* bits = nullptr; size_t width = 0; }; diff --git a/src/spicy/cookie.h b/src/spicy/cookie.h index 86a0449770..b27c64c37d 100644 --- a/src/spicy/cookie.h +++ b/src/spicy/cookie.h @@ -185,6 +185,9 @@ struct Cookie { throw std::runtime_error("invalid cookie"); } + Cookie(const Cookie& other) = delete; + Cookie& operator=(const Cookie& other) = delete; + private: union Data { cookie::ProtocolAnalyzer protocol; @@ -242,9 +245,6 @@ private: packet = &data.packet; } - Cookie(const Cookie& other) = delete; - Cookie& operator=(const Cookie& other) = delete; - friend inline void swap(Cookie& lhs, Cookie& rhs) noexcept { Cookie tmp = std::move(lhs); lhs = std::move(rhs);