title: Error with Google Mock and shared_from_this?
body: <p>I'm getting the following error thrown in a test of mine:</p>
  
  <blockquote>
    <p>unknown file: error: C++ exception with description
    "tr1::bad_weak_ptr" thrown in the test body.</p>
  </blockquote>
  
  <p>Stepping through the test one line at a time I can see the exception is being thrown on a line where I call:</p>
  
  <pre><code>MyClassSharedPointer myClassPointer(shared_from_this());
  </code></pre>
  
  <p>I need a pointer to the object the code is executing in, because I need to set the object up as an observer of one of it's members (using boost::signals to implement the observer).  The code appears to work fine while normally executing but from my test code I get this error.</p>