Suppose I have a diamond inheritance situation as follows:
class A{
public: virtual void foo(){};
};
class B: public virtual A{
public: virtual void foo(){};
};
class C: public virtual A{
public: virtual void foo(){};
};
class D: B, C{};
The last line yields a compilation error citing ambiguity. As I understand it, the problem is that the compiler doesn't know which foo to place in D's vtbl, but why would there even be a vtbl for D if it doesn't define any virtual functions of its own?