testing/cxxtest: Fix the compiler warning
cxxtest_main.cxx: In function ‘void test_rtti()’: cxxtest_main.cxx:199:3: warning: deleting object of polymorphic class type ‘Base’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor] 199 | delete a; | ^~~~~~~~ cxxtest_main.cxx:200:3: warning: deleting object of polymorphic class type ‘Base’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor] 200 | delete b; Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Id80100a09f7b1d5931e7898a1a5a75ca00007c75
This commit is contained in:
parent
7789bbb470
commit
278c9fe5f5
@ -56,7 +56,8 @@ using namespace std;
|
|||||||
class Base
|
class Base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void printBase(void) {};
|
virtual void printBase(void) {}
|
||||||
|
virtual ~Base() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extend : public Base
|
class Extend : public Base
|
||||||
|
Loading…
x
Reference in New Issue
Block a user