From dc9cc9aa0754d834388acabb5a68677f6512b960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Thu, 5 Jan 2023 20:17:57 +0100 Subject: cpp: Expliticly declare compiler generated copy constructors * lang/cpp/src/configuration.h (Component, Option), lang/cpp/src/data.h (Data), lang/cpp/src/decryptionresult.h (DecryptionResult, DecryptionResult::Recipient), lang/cpp/src/encryptionresult.h (EncryptionResult, InvalidRecipient), lang/cpp/src/engineinfo.h (EngineInfo), lang/cpp/src/importresult.h (ImportResult, Import), lang/cpp/src/key.h (Key, Subkey, UserID, UserID::Signature), lang/cpp/src/keygenerationresult.h (KeyGenerationResult), lang/cpp/src/keylistresult.h (KeyListResult), lang/cpp/src/notation.h (Notation), lang/cpp/src/signingresult.h (SigningResult, InvalidSigningKey, CreatedSignature), lang/cpp/src/swdbresult.h (SwdbResult), lang/cpp/src/tofuinfo.h (TofuInfo), lang/cpp/src/verificationresult.h (VerificationResult, Signature), lang/cpp/src/vfsmountresult.h (VfsMountResult): Explitily declare compiler generated copy constructor. -- This fixes "implicitly-declared copy constructor is deprecated" warnings. --- lang/cpp/src/configuration.h | 4 ++-- lang/cpp/src/data.h | 1 + lang/cpp/src/decryptionresult.h | 2 ++ lang/cpp/src/encryptionresult.h | 2 ++ lang/cpp/src/engineinfo.h | 1 + lang/cpp/src/importresult.h | 2 ++ lang/cpp/src/key.h | 4 ++++ lang/cpp/src/keygenerationresult.h | 1 + lang/cpp/src/keylistresult.h | 1 + lang/cpp/src/notation.h | 1 + lang/cpp/src/signingresult.h | 3 +++ lang/cpp/src/swdbresult.h | 1 + lang/cpp/src/tofuinfo.h | 1 + lang/cpp/src/verificationresult.h | 2 ++ lang/cpp/src/vfsmountresult.h | 1 + 15 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lang/cpp/src/configuration.h b/lang/cpp/src/configuration.h index 2e577156..24995dd4 100644 --- a/lang/cpp/src/configuration.h +++ b/lang/cpp/src/configuration.h @@ -98,8 +98,7 @@ public: explicit Component(const shared_gpgme_conf_comp_t &gpgme_comp) : comp(gpgme_comp) {} - // copy ctor is ok - + Component(const Component &other) = default; const Component &operator=(const Component &other) { if (this != &other) { @@ -149,6 +148,7 @@ public: Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt) : comp(gpgme_comp), opt(gpgme_opt) {} + Option(const Option &other) = default; const Option &operator=(const Option &other) { if (this != &other) { diff --git a/lang/cpp/src/data.h b/lang/cpp/src/data.h index df8607e7..649e4104 100644 --- a/lang/cpp/src/data.h +++ b/lang/cpp/src/data.h @@ -60,6 +60,7 @@ public: static const Null null; + Data(const Data &other) = default; const Data &operator=(Data other) { swap(other); diff --git a/lang/cpp/src/decryptionresult.h b/lang/cpp/src/decryptionresult.h index e4d542dd..84026d39 100644 --- a/lang/cpp/src/decryptionresult.h +++ b/lang/cpp/src/decryptionresult.h @@ -47,6 +47,7 @@ public: DecryptionResult(gpgme_ctx_t ctx, const Error &err); explicit DecryptionResult(const Error &err); + DecryptionResult(const DecryptionResult &other) = default; const DecryptionResult &operator=(DecryptionResult other) { swap(other); @@ -103,6 +104,7 @@ public: Recipient(); explicit Recipient(gpgme_recipient_t reci); + Recipient(const Recipient &other) = default; const Recipient &operator=(Recipient other) { swap(other); diff --git a/lang/cpp/src/encryptionresult.h b/lang/cpp/src/encryptionresult.h index 312dfec7..1aea6bb8 100644 --- a/lang/cpp/src/encryptionresult.h +++ b/lang/cpp/src/encryptionresult.h @@ -48,6 +48,7 @@ public: EncryptionResult(gpgme_ctx_t ctx, const Error &error); EncryptionResult(const Error &err); + EncryptionResult(const EncryptionResult &other) = default; const EncryptionResult &operator=(EncryptionResult other) { swap(other); @@ -83,6 +84,7 @@ class GPGMEPP_EXPORT InvalidRecipient public: InvalidRecipient(); + InvalidRecipient(const InvalidRecipient &other) = default; const InvalidRecipient &operator=(InvalidRecipient other) { swap(other); diff --git a/lang/cpp/src/engineinfo.h b/lang/cpp/src/engineinfo.h index 52bf3474..ce7b4eaf 100644 --- a/lang/cpp/src/engineinfo.h +++ b/lang/cpp/src/engineinfo.h @@ -151,6 +151,7 @@ public: EngineInfo(); explicit EngineInfo(gpgme_engine_info_t engine); + EngineInfo(const EngineInfo &other) = default; const EngineInfo &operator=(EngineInfo other) { swap(other); diff --git a/lang/cpp/src/importresult.h b/lang/cpp/src/importresult.h index 59366984..a2749331 100644 --- a/lang/cpp/src/importresult.h +++ b/lang/cpp/src/importresult.h @@ -47,6 +47,7 @@ public: ImportResult(gpgme_ctx_t ctx, const Error &error); explicit ImportResult(const Error &error); + ImportResult(const ImportResult &other) = default; const ImportResult &operator=(ImportResult other) { swap(other); @@ -106,6 +107,7 @@ class GPGMEPP_EXPORT Import public: Import(); + Import(const Import &other) = default; const Import &operator=(Import other) { swap(other); diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index 0e6380db..09f1879f 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -71,6 +71,7 @@ public: static const Null null; + Key(const Key &other) = default; const Key &operator=(Key other) { swap(other); @@ -228,6 +229,7 @@ public: Subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey); Subkey(const shared_gpgme_key_t &key, unsigned int idx); + Subkey(const Subkey &other) = default; const Subkey &operator=(Subkey other) { swap(other); @@ -341,6 +343,7 @@ public: UserID(const shared_gpgme_key_t &key, gpgme_user_id_t uid); UserID(const shared_gpgme_key_t &key, unsigned int idx); + UserID(const UserID &other) = default; const UserID &operator=(UserID other) { swap(other); @@ -459,6 +462,7 @@ public: Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, gpgme_key_sig_t sig); Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, unsigned int idx); + Signature(const Signature &other) = default; const Signature &operator=(Signature other) { swap(other); diff --git a/lang/cpp/src/keygenerationresult.h b/lang/cpp/src/keygenerationresult.h index a92151b4..1cbc9dd3 100644 --- a/lang/cpp/src/keygenerationresult.h +++ b/lang/cpp/src/keygenerationresult.h @@ -44,6 +44,7 @@ public: KeyGenerationResult(gpgme_ctx_t ctx, const Error &error); explicit KeyGenerationResult(const Error &err); + KeyGenerationResult(const KeyGenerationResult &other) = default; const KeyGenerationResult &operator=(KeyGenerationResult other) { swap(other); diff --git a/lang/cpp/src/keylistresult.h b/lang/cpp/src/keylistresult.h index d0a86900..68e2a17b 100644 --- a/lang/cpp/src/keylistresult.h +++ b/lang/cpp/src/keylistresult.h @@ -45,6 +45,7 @@ public: explicit KeyListResult(const Error &err); KeyListResult(const Error &err, const _gpgme_op_keylist_result &res); + KeyListResult(const KeyListResult &other) = default; const KeyListResult &operator=(KeyListResult other) { swap(other); diff --git a/lang/cpp/src/notation.h b/lang/cpp/src/notation.h index 5b89214c..b1ff2d50 100644 --- a/lang/cpp/src/notation.h +++ b/lang/cpp/src/notation.h @@ -44,6 +44,7 @@ public: Notation(); explicit Notation(gpgme_sig_notation_t nota); + Notation(const Notation &other) = default; const Notation &operator=(Notation other) { swap(other); diff --git a/lang/cpp/src/signingresult.h b/lang/cpp/src/signingresult.h index c6654fca..0c2994c7 100644 --- a/lang/cpp/src/signingresult.h +++ b/lang/cpp/src/signingresult.h @@ -50,6 +50,7 @@ public: SigningResult(gpgme_ctx_t ctx, const Error &error); explicit SigningResult(const Error &err); + SigningResult(const SigningResult &other) = default; const SigningResult &operator=(SigningResult other) { swap(other); @@ -86,6 +87,7 @@ class GPGMEPP_EXPORT InvalidSigningKey public: InvalidSigningKey(); + InvalidSigningKey(const InvalidSigningKey &other) = default; const InvalidSigningKey &operator=(InvalidSigningKey other) { swap(other); @@ -119,6 +121,7 @@ public: CreatedSignature(); + CreatedSignature(const CreatedSignature &other) = default; const CreatedSignature &operator=(CreatedSignature other) { swap(other); diff --git a/lang/cpp/src/swdbresult.h b/lang/cpp/src/swdbresult.h index d13b57c8..d4340fe1 100644 --- a/lang/cpp/src/swdbresult.h +++ b/lang/cpp/src/swdbresult.h @@ -62,6 +62,7 @@ public: const char *iversion = NULL, Error *err = NULL); + SwdbResult(const SwdbResult &other) = default; const SwdbResult &operator=(SwdbResult other) { swap(other); diff --git a/lang/cpp/src/tofuinfo.h b/lang/cpp/src/tofuinfo.h index 5bb024f2..67ed62a5 100644 --- a/lang/cpp/src/tofuinfo.h +++ b/lang/cpp/src/tofuinfo.h @@ -39,6 +39,7 @@ public: TofuInfo(); explicit TofuInfo(gpgme_tofu_info_t info); + TofuInfo(const TofuInfo &other) = default; const TofuInfo &operator=(TofuInfo other) { swap(other); diff --git a/lang/cpp/src/verificationresult.h b/lang/cpp/src/verificationresult.h index 3f6299ca..f43bd39f 100644 --- a/lang/cpp/src/verificationresult.h +++ b/lang/cpp/src/verificationresult.h @@ -52,6 +52,7 @@ public: VerificationResult(gpgme_ctx_t ctx, const Error &error); explicit VerificationResult(const Error &err); + VerificationResult(const VerificationResult &other) = default; const VerificationResult &operator=(VerificationResult other) { swap(other); @@ -90,6 +91,7 @@ public: Signature(); + Signature(const Signature &other) = default; const Signature &operator=(Signature other) { swap(other); diff --git a/lang/cpp/src/vfsmountresult.h b/lang/cpp/src/vfsmountresult.h index b46eeb1c..6bc67ba3 100644 --- a/lang/cpp/src/vfsmountresult.h +++ b/lang/cpp/src/vfsmountresult.h @@ -45,6 +45,7 @@ public: VfsMountResult(gpgme_ctx_t ctx, const Error &error, const Error &opError); explicit VfsMountResult(const Error &err); + VfsMountResult(const VfsMountResult &other) = default; const VfsMountResult &operator=(VfsMountResult other) { swap(other); -- cgit v1.2.1