| 1 |
class Mutable |
| 2 |
{ |
| 3 |
public: |
| 4 |
virtual ~Mutable(); |
| 5 |
virtual void func(); |
| 6 |
}; |
| 7 |
|
| 8 |
Mutable::~Mutable() |
| 9 |
{ |
| 10 |
} |
| 11 |
|
| 12 |
class DeriveMutable final : public Mutable |
| 13 |
{ |
| 14 |
public: |
| 15 |
virtual ~DeriveMutable(); |
| 16 |
void func() override; |
| 17 |
}; |
| 18 |
|
| 19 |
DeriveMutable::~DeriveMutable() |
| 20 |
{ |
| 21 |
} |
| 22 |
|
| 23 |
class Const |
| 24 |
{ |
| 25 |
public: |
| 26 |
virtual ~Const(); |
| 27 |
virtual void func() const; |
| 28 |
}; |
| 29 |
|
| 30 |
Const::~Const() |
| 31 |
{ |
| 32 |
} |
| 33 |
|
| 34 |
class DeriveConst final : public Const |
| 35 |
{ |
| 36 |
public: |
| 37 |
virtual ~DeriveConst(); |
| 38 |
void func() const override; |
| 39 |
}; |
| 40 |
|
| 41 |
DeriveConst::~DeriveConst() |
| 42 |
{ |
| 43 |
} |
| 44 |
|
| 45 |
void test23135() |
| 46 |
{ |
| 47 |
DeriveMutable mut; |
| 48 |
mut.func(); |
| 49 |
|
| 50 |
DeriveConst cst; |
| 51 |
cst.func(); |
| 52 |
} |