title: Downcasting in C++ with virtual base class
body: <p>Consider the scenario:</p>
  
  <pre><code>class Base { };
  
  class Derived: public virtual Base {};
  
  int main(void) {
      Derived * d = new Derived();
  
      Base * b = d;
  
      Derived * x = static_cast&lt;Derived*&gt;(b); // Probably impossible
  
      delete x;
  }
  </code></pre>
  
  <p>Here the downcast from pointer to Base to pointer to Derived is giving a compilation error saying "cannot convert since base is virtual". I cannot dynamic cast here since Base is not a polymorphic type. My questions are:</p>
  
  <ol>
  <li>Is this simply impossible to do?</li>
  <li>How does the C++ standard (11 or 14) state that this is impossible?</li>
  </ol>
  
  <p>If it is impossible, I want to understand why. I know that virtual methods are implemented via vptr table, but how are virtual base classes implemented? I also know that the C++ standard does not define implementation, but I would like to understand the implementation of something common like gcc none the less. So the question is:</p>
  
  <ol start="3">
  <li>What is the underlying implementation of a standard compiler like gcc which makes this feature impossible?</li>
  </ol>
  
  <p>This is probably a fairly simple question for all the C++ gurus out there, but I just could not find anything concrete after google-ing for half an hour. Please feel free to duplicate, down-vote etc if this is already covered.</p>