C++ FAQ Celebrating Twenty-One Years of the C++ FAQ!!!
(Click here for a personal note from Marshall Cline.)
Section 25:
[25.9] Where in a hierarchy should I use virtual inheritance?

Just below the top of the diamond, not at the join-class.

To avoid the duplicated base class subobject that occurs with the "dreaded diamond", you should use the virtual keyword in the inheritance part of the classes that derive directly from the top of the diamond:

class Base {
public:
  ...
protected:
  int data_;
};

class Der1 : public virtual Base {
public:             ^^^^^^^—this is the key
  ...
};

class Der2 : public virtual Base {
public:             ^^^^^^^—this is the key
  ...
};

class Join : public Der1, public Der2 {
public:
  void method()
  {
     data_ = 1;   good: this is now unambiguous
  }
};

int main()
{
  Join* j = new Join();
  Base* b = j;    good: this is now unambiguous
}
Because of the virtual keyword in the base-class portion of Der1 and Der2, an instance of Join will have only a single Base subobject. This eliminates the ambiguities. This is usually better than using full qualification as described in the previous FAQ.

For emphasis, the virtual keyword goes in the hierarchy above Der1 and Der2. It doesn't help to put the virtual keyword in the Join class itself. In other words, you have to know that a join class will exist when you are creating class Der1 and Der2.

                         Base
                         /  \
                        /    \
               virtual /      \ virtual
                    Der1      Der2
                       \      /
                        \    /
                         \  /
                         Join