Wikipedia on the diamond problem:
\"... the diamond problem is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and
Your second example is nowhere near the diamond problem because compiler has the ability to detect the available functions one level up of inheritance.
Once the compiler gets to know that you are using same-named functions in two base classes, it will throw error: member 'foo' found in multiple base classes of different types.