Cannot cast 'D' to its private base class 'B'