I have functions that take in std::shared_ptr as an argument so I am forced to use std::shared_ptr, but the object I am passing to the function is not dynamically allocated.
You can do this trick:
A a;
shared_ptr pa(&a);
foo(pa);
new (&pa) shared_ptr(); // pa "forgets" about a