Placing the new one is obviously UB, as it will try to remove your fragment on the stack. An empty deletion version will work, but a link counting block will be highlighted.
The trick is to use the crazy (ok, aliasing) shared_ptr constructor:
template< class Y > shared_ptr( const shared_ptr<Y>& r, T *ptr );
which builds a shared_ptr , owning what r has, but indicating what ptr pointing to, ptr .:
std::shared_ptr<MyStruct> sp(std::shared_ptr<MyStruct>(), p);
It is guaranteed noexcept by standard and does not stand out. There is even a note in the standard that says
[Note. This constructor allows you to create an empty shared_ptr instance with a non-zero stored pointer. -end note]
source share