commit a9fe9d1ac7d615ed18e1a49ce7fc57bd4296df38
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Mon Jul 14 12:40:39 2025 +0200
Fixup 1fb23f02: StartTag and EndTag need a destructor after all
To enforce rule of 3, add a copy constructor and copy assignment operator.
Fixes clang/libc++ warning
/usr/include/c++/v1/__memory/allocator.h:168:81: warning: destructor called
on non-final 'lyx::xml::StartTag' that has virtual functions but non-virtual
destructor [-Wdelete-non-abstract-non-virtual-dtor]
---
src/xml.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/xml.h b/src/xml.h
index e6b4b43705..a2ac96f7bb 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -190,6 +190,14 @@ struct StartTag
explicit StartTag(std::string const & tag, docstring const & attr,
bool keepempty = false, std::string
const & tagtype = "none")
: tag_(from_ascii(tag)), attr_(attr),
keepempty_(keepempty), tagtype_(tagtype) {}
+
+ ///
+ virtual ~StartTag() = default;
+ ///
+ StartTag(StartTag const &) = default;
+ ///
+ StartTag & operator=(StartTag const &) = default;
+
/// <tag_ attr_>
virtual docstring writeTag() const;
/// </tag_>
@@ -220,6 +228,14 @@ struct EndTag
/// Create an EndTag corresponding to the given StartTag.
explicit EndTag(StartTag const & start_tag)
: tag_(start_tag.tag_), tagtype_(start_tag.tagtype_) {}
+
+ ///
+ virtual ~EndTag() = default;
+ ///
+ EndTag(EndTag const &) = default;
+ ///
+ EndTag & operator=(EndTag const &) = default;
+
/// </tag_>
virtual docstring writeEndTag() const;
///
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs