summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-09-07 02:10:36 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-09-07 02:10:36 +0100
commitb851b8f23b1527e35b78bf68e7eecffa3c59589b (patch)
treef1359180e924388accc60e90a8cd743e3c8ae5c3
parentUpdate to C++20 for constexpr virtual destructors (diff)
downloadslicer-b851b8f23b1527e35b78bf68e7eecffa3c59589b.tar.bz2
slicer-b851b8f23b1527e35b78bf68e7eecffa3c59589b.tar.xz
slicer-b851b8f23b1527e35b78bf68e7eecffa3c59589b.zip
Add missing virtual destructors
-rw-r--r--Jamroot.jam1
-rw-r--r--slicer/slicer/modelParts.h3
-rw-r--r--slicer/slicer/modelPartsTypes.h2
-rw-r--r--slicer/slicer/modelPartsTypes.impl.h1
4 files changed, 7 insertions, 0 deletions
diff --git a/Jamroot.jam b/Jamroot.jam
index 7910d73..5403aed 100644
--- a/Jamroot.jam
+++ b/Jamroot.jam
@@ -17,6 +17,7 @@ project
<variant>release:<lto>on
<variant>debug:<warnings>extra
<variant>debug:<warnings-as-errors>on
+ <variant>debug:<cflags>-Wnon-virtual-dtor
<variant>coverage:<coverage>on
<toolset>tidy:<checkxx>boost-*
<toolset>tidy:<checkxx>bugprone-*
diff --git a/slicer/slicer/modelParts.h b/slicer/slicer/modelParts.h
index b0de888..dd496ec 100644
--- a/slicer/slicer/modelParts.h
+++ b/slicer/slicer/modelParts.h
@@ -17,6 +17,7 @@ namespace Ice {
namespace Slicer {
template<typename T> class TValueTarget {
public:
+ virtual ~TValueTarget() = default;
virtual void get(const T &) const = 0;
};
class ValueTarget :
@@ -41,6 +42,7 @@ namespace Slicer {
template<typename T> class TValueSource {
public:
+ virtual ~TValueSource() = default;
virtual void set(T &) const = 0;
};
class ValueSource :
@@ -111,6 +113,7 @@ namespace Slicer {
name(n), nameLower(nl), nameStr(ns)
{
}
+ virtual ~HookCommon() = default;
[[nodiscard]] bool filter(const HookFilter & flt) const;
void apply(const ChildHandler & ch, const ModelPartPtr & modelPart) const;
diff --git a/slicer/slicer/modelPartsTypes.h b/slicer/slicer/modelPartsTypes.h
index 2d959ea..2bbc9c9 100644
--- a/slicer/slicer/modelPartsTypes.h
+++ b/slicer/slicer/modelPartsTypes.h
@@ -313,6 +313,8 @@ namespace Slicer {
using Consumer = std::function<void(const T &)>;
using element_type = T;
+ virtual ~Stream() = default;
+
virtual void Produce(const Consumer & c) = 0;
};
diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h
index ba30abe..4d5f991 100644
--- a/slicer/slicer/modelPartsTypes.impl.h
+++ b/slicer/slicer/modelPartsTypes.impl.h
@@ -385,6 +385,7 @@ namespace Slicer {
{
static_assert(sizeof...(MD) == N, "Wrong amount of metadata");
}
+ ~Hook() = default;
[[nodiscard]] const Metadata &
GetMetadata() const override