title: Why delete a class without virtual dtor is OK if it inherits a class with virtual dtor
body: <p>Consider below code</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;memory&gt;
  
  struct Base1
  {
      Base1() = default;
      virtual ~Base1() = default;
      //~Base1() = default;
  };
  
  struct Base2 : public Base1
  {
      Base2()
      {
          printf("%s:%d:%s\n", __FILE__, __LINE__, __func__);
      }
      ~Base2() // non-virtual destructor
      {
          printf("%s:%d:%s\n", __FILE__, __LINE__, __func__);
      }
  };
  
  struct Derive : public Base2
  {
      Derive()
      {
          printf("%s:%d:%s\n", __FILE__, __LINE__, __func__);
      }
      ~Derive()
      {
          printf("%s:%d:%s\n", __FILE__, __LINE__, __func__);
      }
  };
  
  int main()
  {
      std::unique_ptr&lt;Base2&gt; d = std::make_unique&lt;Derive&gt;();
      return 0;
  }
  </code></pre>
  
  <p>The class <code>Base2</code> has no virtual destructor, but it inherits <code>Base1</code> which has a virtual destructor.</p>
  
  <p>The code <code>std::unique_ptr&lt;Base2&gt; d = std::make_unique&lt;Derive&gt;();</code> is trying to delete <code>Base2</code> on an object of type <code>Derive</code>, I was expecting only <code>Base2</code>'s dtor is called, but not for <code>Derive</code>.</p>
  
  <p>But actually it works fine:</p>
  
  <pre><code>main.cpp:15:Base2
  main.cpp:27:Derive
  main.cpp:31:~Derive
  main.cpp:19:~Base2
  </code></pre>
  
  <p>So it looks like as long as the "real" base class (here it's <code>Base1</code>) has virtual dtor, all the inherited classes are not required to have virtual dtor, is it?
  If yes, where can I find the related document about this?</p>