Skip to content

Commit

Permalink
COMP: Add virtual destructor to TestClass in ExceptionObject unit test
Browse files Browse the repository at this point in the history
Addressed Mac10.14-AppleClang-dbg-ASanUBSan warning:

> itkExceptionObjectGTest.cxx:29:9: warning: 'TestClass' has virtual
> functions but non-virtual destructor [-Wnon-virtual-dtor]

From https://open.cdash.org/viewBuildError.php?type=1&buildid=7093971

Reported by Jon Haitz Legarreta Gorroño at
#2374 (comment)

Also added an explicit default-constructor, and disallowed copy and move.
  • Loading branch information
N-Dekker committed Mar 12, 2021
1 parent 289564b commit e2c62fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Modules/Core/Common/test/itkExceptionObjectGTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ TEST(ExceptionObject, TestDescriptionFromExceptionMacro)
class TestClass
{
public:
ITK_DISALLOW_COPY_AND_MOVE(TestClass);
TestClass() = default;
virtual ~TestClass() = default;

itkTypeMacroNoParent(TestClass);

void
Expand Down

0 comments on commit e2c62fa

Please sign in to comment.