From 5ee837efbbbba941671d6c4ffe31aa233fd5f855 Mon Sep 17 00:00:00 2001 From: sarveshkumarv3 <86755931+sarveshkumarv3@users.noreply.github.com> Date: Thu, 17 Mar 2022 22:18:30 -0700 Subject: [PATCH] [crypto] compilation fix for clang10 -Wdeprecated-copy (#7487) Deleting a copy constructor without specifying an explicit assignment operator causes an error in clang10 (-Wdeprecated-copy). Since explicit assignment operator defined in OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE case, added the copy constructor deletion also under the same. If the macro is not enabled, implicit copy constructor and assignment operator would take effect. --- src/core/mac/mac_types.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/mac/mac_types.hpp b/src/core/mac/mac_types.hpp index cd2802e31..6e8ba3792 100644 --- a/src/core/mac/mac_types.hpp +++ b/src/core/mac/mac_types.hpp @@ -469,6 +469,8 @@ public: * */ KeyMaterial &operator=(const KeyMaterial &aOther); + + KeyMaterial(const KeyMaterial &) = delete; #endif /** @@ -539,8 +541,6 @@ public: */ bool operator==(const KeyMaterial &aOther) const; - KeyMaterial(const KeyMaterial &) = delete; - private: #if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE static constexpr KeyRef kInvalidKeyRef = Crypto::Storage::kInvalidKeyRef;