title: Compile errors while using shared_ptr with enable_shared_from_this on clang++
body: <p>Consider this piece of code</p>
  
  <pre><code>#include &lt;memory&gt;
  
  class FooBar :  public std::enable_shared_from_this&lt;FooBar&gt;{};
  typedef std::shared_ptr&lt;const FooBar&gt; ConstantPointer;
  
  int main()
  {
    ConstantPointer  p(new FooBar());
    return 0;
  }
  </code></pre>
  
  <p>On g++ version 4.7.4 it compiles without problems when using <strong>-std=c++11</strong> option</p>
  
  <p>On clang++ version 
  <strong>Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)</strong></p>
  
  <p>it generates the following compile error</p>
  
  <pre><code>In file included from main.cpp:1:
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4013:35: error: no viable overloaded '='
                  __e-&gt;__weak_this_ = *this;
                  ~~~~~~~~~~~~~~~~~ ^ ~~~~~
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4050:5: note: in instantiation of function template specialization
        'std::__1::shared_ptr&lt;const FooBar&gt;::__enable_weak_this&lt;FooBar&gt;' requested here
      __enable_weak_this(__p);
      ^
  main.cpp:8:20: note: in instantiation of function template specialization 'std::__1::shared_ptr&lt;const FooBar&gt;::shared_ptr&lt;FooBar, void&gt;' requested here
    ConstantPointer  p(new FooBar());
                     ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4942:15: note: candidate function not viable: no known conversion from
        'std::__1::shared_ptr&lt;const FooBar&gt;' to 'const std::__1::weak_ptr&lt;FooBar&gt;' for 1st argument
      weak_ptr&amp; operator=(weak_ptr const&amp; __r) _NOEXCEPT;
                ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4949:9: note: candidate template ignored: could not match 'weak_ptr' against 'shared_ptr'
          operator=(weak_ptr&lt;_Yp&gt; const&amp; __r) _NOEXCEPT;
          ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4967:13: note: candidate template ignored: disabled by 'enable_if' [with _Yp = const FooBar]
              is_convertible&lt;_Yp*, element_type*&gt;::value,
  </code></pre>
  
  <p>My question is if it is compiler bug or non confirming code ?</p>