From 9952af8e9364b7a25387f896102196717e84ce2b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 3 Jul 2023 23:58:23 +0200 Subject: [PATCH] Define explicit copy ctor for classes with assignment operator This avoids clang -Wdeprecated-copy enabled by -Wextra when building the test. --- tests/hashes/hashes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/hashes/hashes.cpp b/tests/hashes/hashes.cpp index 82e9de6afc..b4fb8fb162 100644 --- a/tests/hashes/hashes.cpp +++ b/tests/hashes/hashes.cpp @@ -497,6 +497,8 @@ struct MyStruct class MyHash { public: + MyHash() = default; + MyHash(const MyHash&) = default; unsigned long operator()(const MyStruct& s) const { return m_dummy(s.ptr); } MyHash& operator=(const MyHash&) { return *this; } @@ -507,6 +509,8 @@ private: class MyEqual { public: + MyEqual() = default; + MyEqual(const MyEqual&) = default; bool operator()(const MyStruct& s1, const MyStruct& s2) const { return s1.ptr == s2.ptr; } MyEqual& operator=(const MyEqual&) { return *this; }