You are right, std::shared_ptr does not affect alignment. It simply accepts a pointer to an already selected object, so if this distribution led to a displaced object, the problem is not in std::shared_ptr , but in that selection.
But std::shared_ptr often used with std::make_shared . std::make_shared<T> performs one allocation of backup memory for both the std::shared_ptr control structure and the T instance. This distribution is not performed using any operator new for the class (and should not be). If the operator new class for the class sets a lowercase alignment than what the default allocator does, then it's easy to see how this can happen if the default allocator is used.
source share