It looks like a diamond problem, but it is not.
Yes it is; that's the classic "diamond" pattern. Perhaps you mean, the problem isn't caused by the presence of the diamond? That's certainly true, so I wonder why you included that red herring in the question. You'll get the same issue from a simpler example:
struct B {
virtual void f() { cout << "B::f()" << endl;};
};
struct C {
virtual void f() { cout << "C::f()" << endl;};
};
struct D : B, C { };
compile error here because D has two candidates f() to override.
No, the error is because D
doesn't override them, so there are two candidates for the function call. The virtual function is overridden in both direct base classes, but not in the derived class, so there is no unique final overrider.
You need to decide what D::f()
is supposed to do, and implement it accordingly.