add missing virtual destructors

This commit is contained in:
Jake Hillion 2023-02-02 15:19:48 -08:00 committed by Jake Hillion
parent 13bbe2e1bb
commit 9cb8fd7a97
3 changed files with 9 additions and 0 deletions

View File

@ -2,18 +2,21 @@ includes = ["vector"]
definitions = '''
class A {
public:
virtual ~A() = default;
virtual void myfunc() {}
int int_a;
};
class B : public A {
public:
virtual ~B() = default;
virtual void myfunc() override {}
std::vector<int> vec_b;
};
class C : public B {
public:
virtual ~C() = default;
virtual void myfunc() override {}
int int_c;
};

View File

@ -2,24 +2,28 @@ includes = ["vector"]
definitions = '''
class Root {
public:
virtual ~Root() = default;
virtual void myfunc() {}
int int_root;
};
class Middle1 : public Root {
public:
virtual ~Middle1() = default;
virtual void myfunc() override {}
std::vector<int> vec_middle1;
};
class Middle2 : public Root {
public:
virtual ~Middle2() = default;
virtual void myfunc() override {}
std::vector<int> vec_middle2;
};
class Child : public Middle1, public Middle2 {
public:
virtual ~Child() = default;
virtual void myfunc() override {}
int int_child;
};

View File

@ -7,12 +7,14 @@ definitions = '''
class B : public A {
public:
virtual ~B() = default;
virtual void myfunc() {}
std::vector<int> vec_b;
};
class C : public B {
public:
virtual ~C() = default;
virtual void myfunc() override {}
int int_c;
};