title: clang error: non-const lvalue reference cannot bind to incompatible temporary
body: <p>I have a piece of code that works fine with MSVC but fails to compile with clang++</p>
  
  <pre><code>void MyCass::someMethod()
  {
     std::wstring key(...);
     auto&amp; refInstance = m_map.find(key); // error here
  }
  </code></pre>
  
  <p>where m_map is defined as</p>
  
  <pre><code>std::map&lt;const std::wstring, std::shared_ptr&lt;IInterface&gt;&gt; m_map;
  </code></pre>
  
  <p>and clang complains </p>
  
  <pre><code>non-const lvalue reference cannot bind to incompatible temporary
  </code></pre>
  
  <p>I somewhat understand that a temporary is being created but not sure how to go fixing this. Any ideas?</p>