title: Crash with shared_ptr
body: <p>Can someone explain to me why the crash here?</p>
  
  <pre><code>#include &lt;memory&gt;
  #include &lt;functional&gt;
  
  struct Teacher : std::enable_shared_from_this&lt;Teacher&gt; {
      struct Timetable;
      std::shared_ptr&lt;Timetable&gt; timetable;
      Teacher (int n) : timetable(std::make_shared&lt;Timetable&gt;(*this, n)) {}
  };
  
  struct Period {
      std::shared_ptr&lt;Teacher&gt; teacher;
      Period (const std::shared_ptr&lt;Teacher&gt;&amp; t) : teacher(t) {}
  };
  
  struct Teacher::Timetable {
      Teacher&amp; teacher;
      std::shared_ptr&lt;Period&gt; homeForm;
      Timetable (Teacher&amp; t, int n) : teacher(t),  // Assume something is done with n.
          homeForm( std::make_shared&lt;Period&gt;(teacher.shared_from_this()) ) {}  // Crashes.
  //      homeForm( std::make_shared&lt;Period&gt;(std::shared_ptr&lt;Teacher&gt;(&amp;teacher)) ) {}  // Also crashes.
  };
  
  int main() {
      std::shared_ptr&lt;Teacher&gt; teacher = std::make_shared&lt;Teacher&gt;(3);
  }
  </code></pre>
  
  <p>Isn't <code>teacher.shared_from_this()</code> allowed here since <code>std::shared_ptr&lt;Teacher&gt; teacher</code> is a shared_ptr already?  If not, how do I initialize <code>homeForm</code> properly?</p>