title: friend class must be public, clang's bug?
body: <p>I tried to compile someone's <a href="https://github.com/lhmouse/intrusive_ptr" rel="nofollow">intrusive_ptr</a> with <code>clang 3.7</code> &amp; <code>-std=c++1z</code>, and it generates <a href="http://goo.gl/LnPBz2" rel="nofollow">errors below</a> ( GCC 5.2.1 is Ok ) :</p>
  
  <pre><code>In file included from test_intrusive_ptr.cpp:10:
  ./intrusive_ptr.hpp:539:53: error: '_Weak_observer' is a private member of
  'std::_Intrusive_ptr_impl::_Deleteable&lt;std::default_delete&lt;foo&gt; &gt;'
      using _Observer = typename intrusive_base&lt;_T, _D&gt;::_Weak_observer;
                                                         ^
  test_intrusive_ptr.cpp:27:21: note: in instantiation of template      class 'std::intrusive_weak_ptr&lt;foo&gt;' requested here
  template class std::intrusive_weak_ptr&lt;foo&gt;;
                  ^
  ./intrusive_ptr.hpp:141:9: note: implicitly declared private here
  class _Weak_observer : public _Ref_count_base {
                    ^
  ./intrusive_ptr.hpp:556:24: error: '__create_observer' is a private member of
  'std::_Intrusive_ptr_impl::_Deleteable&lt;std::default_delete&lt;foo&gt; &gt;'
      __observer = __rhs-&gt;__create_observer();
                                          ^
  test_intrusive_ptr.cpp:27:21: note: in instantiation of member function 'std::intrusive_weak_ptr&lt;foo,
  std::default_delete&lt;foo&gt; &gt;::intrusive_weak_ptr' requested here
      template class std::intrusive_weak_ptr&lt;foo&gt;;
                  ^
  ./intrusive_ptr.hpp:174:20: note: implicitly declared private here
  _Weak_observer * __create_observer() const volatile {
                               ^
  2 errors generated.
  </code></pre>
  
  <p>But the code compiles well after I add <code>public</code> at line 134. Is that a bug in Clang?</p>