This was found by a third-party testsuite, which complained because we only define get_deleter(const __shared_ptr&) and not the corect signature. * include/bits/shared_ptr.h (get_deleter): Add overload matching standard signature. * include/bits/shared_ptr_base.h (__shared_ptr): Declare new get_deleter overload as a friend. * testsuite/20_util/shared_ptr/misc/get_deleter.cc: New. Tested powerpc64le-linux, committed to trunk.