mirror of
https://github.com/google/googletest.git
synced 2024-12-27 10:11:03 +08:00
Googletest export
Use override instead of virtual for destructor https://google.github.io/styleguide/cppguide.html says: "Explicitly annotate overrides of virtual functions or virtual destructors with exactly one of an override or (less frequently) final specifier. Do not use virtual when declaring an override". The mocked class _should_ have a virtual destructor most of the times. PiperOrigin-RevId: 342082140
This commit is contained in:
parent
0e202cdbe3
commit
9dce5e5d87
@ -3078,7 +3078,7 @@ class MockFoo : public Foo {
|
|||||||
...
|
...
|
||||||
// Add the following two lines to the mock class.
|
// Add the following two lines to the mock class.
|
||||||
MOCK_METHOD(void, Die, ());
|
MOCK_METHOD(void, Die, ());
|
||||||
virtual ~MockFoo() { Die(); }
|
~MockFoo() override { Die(); }
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user