Yes, it is legal and there are no restrictions on Base.
However, you should be aware that this leads to the fact that Bazthere are two different types of types Basethat require you to use qualified names to tell C ++ which version Baseyou have in mind when trying to access its members.
C ++ provides a mechanism called virtual inheritance to solve this problem (if this is a problem for you):
class Base { };
class Foo : public virtual Base { };
class Bar : public virtual Base { };
class Baz : public Foo, public Bar { };
This will divide the object Basebetween objects Fooand BarinBaz