title: Why is Default constructor called in virtual inheritance?
body: <p>I don't understand why in the following code, when I instanciate an object of type <code>daughter</code>, the default <code>grandmother()</code> constructor is called ?</p>
  
  <p>I thought that either the <code>grandmother(int)</code> constructor should be called (to follow the specification of my <code>mother</code> class constructor), or this code shouldn't compile at all because of the virtual inheritance.</p>
  
  <p>Here compiler silently calls <code>grandmother</code> default constructor in my back, whereas I never asked for it.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class grandmother {
  public:
      grandmother() {
          std::cout &lt;&lt; "grandmother (default)" &lt;&lt; std::endl;
      }
      grandmother(int attr) {
          std::cout &lt;&lt; "grandmother: " &lt;&lt; attr &lt;&lt; std::endl;
      }
  };
  
  class mother: virtual public grandmother {
  public:
      mother(int attr) : grandmother(attr) {
          std::cout &lt;&lt; "mother: " &lt;&lt; attr &lt;&lt; std::endl;
      }
  };
  
  class daughter: virtual public mother {
  public:
      daughter(int attr) : mother(attr) {
          std::cout &lt;&lt; "daughter: " &lt;&lt; attr &lt;&lt; std::endl;
      }
  };
  
  int main() {
    daughter x(0);
  }
  </code></pre>