title: std::shared_ptr which is null but not empty
body: <p>Compare with: <a href="https://stackoverflow.com/questions/61480691/stdshared-ptr-which-is-empty-but-not-null">std::shared_ptr which is empty but not null</a></p>
  <p>The <code>std::shared_ptr&lt;T&gt;</code> aliasing constructor lets us play interesting games. The above SO post discusses when the first argument is <code>std::shared_ptr&lt;void&gt;{nullptr}</code>. I'm interested in the reverse. Is this guaranteed to keep the pointed-to object alive even though the <code>shared_ptr</code> &quot;is&quot; <code>nullptr</code> (and would be completely unreachable if it weren't that we keep a reference to it)?:</p>
  <pre><code>std::shared_ptr&lt;S&gt; ps = std::make_shared&lt;S&gt;();
  auto&amp; s = *ps; // Keep a reference to the S.
  auto p = std::shared_ptr&lt;S&gt;(ps, nullptr); // Aliasing c'tor with null pointer.
  ps = nullptr;
  assert(ps == nullptr);
  assert(p == nullptr);
  foo(s); //&lt; Is the S still alive here?
  </code></pre>
  <p><a href="https://godbolt.org/z/M19s54" rel="nofollow noreferrer">https://godbolt.org/z/M19s54</a></p>