Describe the bug
I was using the "wasteful virtuals" heuristic to try and optimize a large binary. The "virtuals with no overrides" list specifically is easy gains. However, one of the methods flagged does have overrides and removing the virtual keyword introduced a build break.
On closer inspection the problem seems to be that the virtual method and the override has at least one other derived class in the middle.
The heirarchy is roughly as follows:
class A
{
public:
virtual void DoStuff() { }
};
class B : public A
{ };
class C : public B
{
public:
void DoStuff() override { }
};
In this case A::DoStuff is considered a wasteful virtual even though C::DoStuff overrides it. Removing the virtual keyword will introduce a build break.
Expected behavior
This method should not be considered wasteful.
Screenshots
N/A
Environment Details
OS is Windows 11.
SizeBench is latest version from the Store at this time (on a different device so I don't have the exact version handy).
Additional context
N/A
Describe the bug
I was using the "wasteful virtuals" heuristic to try and optimize a large binary. The "virtuals with no overrides" list specifically is easy gains. However, one of the methods flagged does have overrides and removing the virtual keyword introduced a build break.
On closer inspection the problem seems to be that the virtual method and the override has at least one other derived class in the middle.
The heirarchy is roughly as follows:
In this case
A::DoStuffis considered a wasteful virtual even thoughC::DoStuffoverrides it. Removing the virtual keyword will introduce a build break.Expected behavior
This method should not be considered wasteful.
Screenshots
N/A
Environment Details
OS is Windows 11.
SizeBench is latest version from the Store at this time (on a different device so I don't have the exact version handy).
Additional context
N/A