Declare default virtual destructors to quiet [-Wnon-virtual-dtor]#405
Declare default virtual destructors to quiet [-Wnon-virtual-dtor]#405bashi-bazouk wants to merge 1 commit intomicrosoft:masterfrom bashi-bazouk:master
Conversation
…ual-dtor] errors.
|
I get that these types are just for unit tests, but these are all COM types where the destructor really shouldn't be part of the v-table because the type destroys itself in the |
| IDerivedTest : public ITest | ||
| { | ||
| STDMETHOD_(void, TestDerived)() = 0; | ||
| virtual ~ITest() = default; |
There was a problem hiding this comment.
This should be ~IDerivedTest - you can't declare a destructor for a base type.
| IDerivedTestInspectable : public ITestInspectable | ||
| { | ||
| STDMETHOD_(void, TestInspctableDerived)() = 0; | ||
| virtual ~ITestInspectable() = default; |
There was a problem hiding this comment.
Same as above; s/b ~IDerivedTestInspectable
|
In a earlier project, we kept finding leaks when someone had the pattern So I'm sympathetic to the warning. Should it be firing for types that contain only types with trivial destructors, though? Like the So the two that need it in this change are the |
This change allows compiling ComTests.cpp and ResourceTests.cpp with -Werror -Wnon-virtual-dtor enabled.