commit 3000116ae7e67f8709a0f845931e875bc27688cd
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Fri Jul 11 18:03:55 2025 +0200
Implement rule of 3
Since a destructor is required here, declare explicitly assignment copy
operators and copy constructors as default.
Fixes warnings:
src/insets/InsetListings.h:36:2: warning: definition of implicit copy
constructor for 'InsetListings' is deprecated because it has a user-provided
destructor [-Wdeprecated-copy-with-user-provided-dtor]
src/insets/InsetNote.h:52:2: warning: definition of implicit copy
constructor for 'InsetNote' is deprecated because it has a user-provided
destructor [-Wdeprecated-copy-with-user-provided-dtor]
src/insets/InsetPhantom.h:52:2: warning: definition of implicit copy
constructor for 'InsetPhantom' is deprecated because it has a user-provided
destructor [-Wdeprecated-copy-with-user-provided-dtor]
src/insets/InsetWrap.h:50:2: warning: definition of implicit copy
constructor for 'InsetWrap' is deprecated because it has a user-provided
destructor [-Wdeprecated-copy-with-user-provided-dtor]
src/tex2lyx/Context.h:86:2: warning: definition of implicit copy
constructor for 'Context' is deprecated because it has a user-provided
destructor [-Wdeprecated-copy-with-user-provided-dtor]
---
src/insets/InsetListings.h | 4 ++++
src/insets/InsetNote.h | 4 ++++
src/insets/InsetPhantom.h | 4 ++++
src/insets/InsetWrap.h | 4 ++++
src/tex2lyx/Context.h | 6 ++++++
5 files changed, 22 insertions(+)
diff --git a/src/insets/InsetListings.h b/src/insets/InsetListings.h
index df4d1e422e..e01b5fd498 100644
--- a/src/insets/InsetListings.h
+++ b/src/insets/InsetListings.h
@@ -33,8 +33,12 @@ public:
///
InsetListings(Buffer *, InsetListingsParams const & par =
InsetListingsParams());
///
+ InsetListings(InsetListings const &) = default;
+ ///
~InsetListings();
///
+ InsetListings & operator=(InsetListings const &) = default;
+ ///
static void string2params(std::string const &, InsetListingsParams &);
///
static std::string params2string(InsetListingsParams const &);
diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h
index 25e91f88eb..962ccd7f4a 100644
--- a/src/insets/InsetNote.h
+++ b/src/insets/InsetNote.h
@@ -49,8 +49,12 @@ public:
///
InsetNote(Buffer *, std::string const &);
///
+ InsetNote(InsetNote const &) = default;
+ ///
~InsetNote();
///
+ InsetNote & operator=(InsetNote const &) = default;
+ ///
static std::string params2string(InsetNoteParams const &);
///
static void string2params(std::string const &, InsetNoteParams &);
diff --git a/src/insets/InsetPhantom.h b/src/insets/InsetPhantom.h
index 57f08102ba..b3a80efe6a 100644
--- a/src/insets/InsetPhantom.h
+++ b/src/insets/InsetPhantom.h
@@ -49,8 +49,12 @@ public:
///
InsetPhantom(Buffer *, std::string const &);
///
+ InsetPhantom(InsetPhantom const &) = default;
+ ///
~InsetPhantom();
///
+ InsetPhantom & operator=(InsetPhantom const &) = default;
+ ///
static std::string params2string(InsetPhantomParams const &);
///
static void string2params(std::string const &, InsetPhantomParams &);
diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h
index 01541fdabf..fba44c058f 100644
--- a/src/insets/InsetWrap.h
+++ b/src/insets/InsetWrap.h
@@ -47,8 +47,12 @@ public:
///
InsetWrap(Buffer *, std::string const &);
///
+ InsetWrap(InsetWrap const &) = default;
+ ///
~InsetWrap();
///
+ InsetWrap & operator=(InsetWrap const &) = default;
+ ///
InsetWrapParams const & params() const { return params_; }
///
static void string2params(std::string const &, InsetWrapParams &);
diff --git a/src/tex2lyx/Context.h b/src/tex2lyx/Context.h
index ea2d04de4a..8e0d188528 100644
--- a/src/tex2lyx/Context.h
+++ b/src/tex2lyx/Context.h
@@ -83,7 +83,13 @@ public:
Layout const * layout_ = 0,
Layout const * parent_layout_= 0,
TeXFont const & font_ = normalfont);
+ ///
+ Context(Context const &) = default;
+ ///
~Context();
+ ///
+ Context & operator=(Context const &) = default;
+
/// Output a \\begin_layout if requested
void check_layout(std::ostream & os);
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs