From 3dfc7c57e0b9b559d01cc9fbc0ac1f624df2c53b Mon Sep 17 00:00:00 2001 From: Itms Date: Wed, 28 Aug 2024 21:44:06 +0200 Subject: [PATCH] Explicitly default copy ctors for some classes This fixes -Wdeprecated-copy with FreeBSD's clang17. This commit reverts a change from 8a32b0b3d4, where a private copy assignment operator was deleted, whereas it was needed to explicitly declare the copy constructor, refs #5294. --- source/ps/CStrIntern.cpp | 2 ++ source/tools/atlas/GameInterface/MessagesSetup.h | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/ps/CStrIntern.cpp b/source/ps/CStrIntern.cpp index 9717a45314..0d260c97c4 100644 --- a/source/ps/CStrIntern.cpp +++ b/source/ps/CStrIntern.cpp @@ -34,6 +34,8 @@ public: // LOGWARNING("New interned string '%s'", data.c_str()); } + CStrInternInternals(const CStrInternInternals& b) = default; + bool operator==(const CStrInternInternals& b) const { // Compare hash first for quick rejection of inequal strings diff --git a/source/tools/atlas/GameInterface/MessagesSetup.h b/source/tools/atlas/GameInterface/MessagesSetup.h index 71b075a72c..f4fe92b0a7 100644 --- a/source/tools/atlas/GameInterface/MessagesSetup.h +++ b/source/tools/atlas/GameInterface/MessagesSetup.h @@ -91,8 +91,9 @@ const bool NOMERGE = false; #define COMMANDDATASTRUCT(t) \ struct d##t { \ private: \ - d##t& operator=(const d##t&) = delete; \ - public: + const d##t& operator=(const d##t&); \ + public: \ + d##t(const d##t& d) = default; #define COMMANDSTRUCT(t, merge) \ struct m##t : public mWorldCommand, public d##t { \