diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2013-06-27 17:25:34 -0400 |
---|---|---|
committer | John Ehresman <jpe@wingware.com> | 2013-06-28 23:16:06 +0200 |
commit | 288f57f34fe1ebec409ec60868d5bde057440886 (patch) | |
tree | 4bd7f68704e49538a025f3f525dbfe7da3ff1204 /tests/libsample | |
parent | 297f2708dfd049b8b475ee1e680a788f0dfe164b (diff) |
Don't break -Werror=non-virtual-dtor
Classes with virtual methods but non-virtual destructors are dangerous,
because users often hold pointers-to-base-class of derived classes,
which cannot correctly destruct the derived class if deleted. As such,
there is the aforementioned warning that developers may like to promote
to an error. Add virtual (empty) destructors to some classes that were
tripping this, so that we build successfully if said flag is used, and
because they should probably be present.
Change-Id: I930ad5f5d122cf94c57e52bf28479cf3ca7950d4
Reviewed-by: John Cummings <jcummings2@users.sf.net>
Reviewed-by: John Ehresman <jpe@wingware.com>
Diffstat (limited to 'tests/libsample')
-rw-r--r-- | tests/libsample/ctorconvrule.h | 1 | ||||
-rw-r--r-- | tests/libsample/objecttypeoperators.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/tests/libsample/ctorconvrule.h b/tests/libsample/ctorconvrule.h index b8f63836e..6d2afc921 100644 --- a/tests/libsample/ctorconvrule.h +++ b/tests/libsample/ctorconvrule.h @@ -29,6 +29,7 @@ class CtorConvRule { public: explicit CtorConvRule(long value) : m_value(value) {} + virtual ~CtorConvRule() {} virtual void dummyVirtualMethod() {} long value() { return m_value; } private: diff --git a/tests/libsample/objecttypeoperators.h b/tests/libsample/objecttypeoperators.h index 8df2623c3..83811fd96 100644 --- a/tests/libsample/objecttypeoperators.h +++ b/tests/libsample/objecttypeoperators.h @@ -30,6 +30,7 @@ class LIBSAMPLE_API ObjectTypeOperators { public: explicit ObjectTypeOperators(const std::string key); + virtual ~ObjectTypeOperators() {} bool operator==(const ObjectTypeOperators& other) const; const ObjectTypeOperators& operator<(const ObjectTypeOperators& other) const; |