title: Can't use std::unique_ptr<T> with T being a forward declaration
body: <p>Now first, I am aware of the general issues with unique_ptr&lt;> and forward declarations as in <a href="https://stackoverflow.com/questions/13414652/forward-declaration-with-unique-ptr">Forward declaration with unique_ptr?</a> .</p>
  
  <p>Consider these three files:</p>
  
  <p>A.h</p>
  
  <pre><code>#include &lt;memory&gt;
  #include &lt;vector&gt;
  
  class B;
  
  class A
  {
  public:
      ~A();
  
  private:
      std::unique_ptr&lt;B&gt; m_tilesets;
  };
  </code></pre>
  
  <p>C.cpp</p>
  
  <pre><code>#include "A.h"
  
  class B {
  
  };
  
  A::~A() {
  
  }
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include &lt;memory&gt;
  
  #include "A.h"
  
  int main() {
      std::unique_ptr&lt;A&gt; m_result(new A());
  }
  </code></pre>
  
  <p>Issuing <code>g++ -std=c++11 main.cpp C.cpp</code> yields the following error:</p>
  
  <pre><code>In file included from /usr/include/c++/4.8/memory:81:0,
                   from main.cpp:1:
  /usr/include/c++/4.8/bits/unique_ptr.h: In instantiation of ‘void std::default_delete&lt;_Tp&gt;::operator()(_Tp*) const [with _Tp = B]’:
  /usr/include/c++/4.8/bits/unique_ptr.h:184:16:   required from ‘std::unique_ptr&lt;_Tp, _Dp&gt;::~unique_ptr() [with _Tp = B; _Dp = std::default_delete&lt;B&gt;]’
  A.h:6:7:   required from here
  /usr/include/c++/4.8/bits/unique_ptr.h:65:22: error: invalid application of ‘sizeof’ to incomplete type ‘B’
    static_assert(sizeof(_Tp)&gt;0,
  </code></pre>
  
  <p>That's true, B is an incomplete type in line 6 of A.h - but that's not where A's destructor is! g++ seems to generate a destructor for A even though I am providing one. A's destructor is in C.cpp line 7 and there B is a perfectly defined type. Why am I getting this error?</p>