-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declare default virtual destructors to quiet [-Wnon-virtual-dtor] #405
base: master
Are you sure you want to change the base?
Conversation
…ual-dtor] errors.
@bashi-bazouk please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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 |
@@ -614,6 +617,7 @@ interface __declspec(uuid("ececcc6a-5193-4d14-b38e-ed1460c20a01")) | |||
IDerivedTest : public ITest | |||
{ | |||
STDMETHOD_(void, TestDerived)() = 0; | |||
virtual ~ITest() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ~IDerivedTest
- you can't declare a destructor for a base type.
@@ -626,18 +630,21 @@ interface __declspec(uuid("ececcc6a-5193-4d14-b38e-ed1460c20a03")) | |||
IDerivedTestInspectable : public ITestInspectable | |||
{ | |||
STDMETHOD_(void, TestInspctableDerived)() = 0; | |||
virtual ~ITestInspectable() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.