diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -4174,7 +4174,7 @@ typedef __shared_ptr_pointer<_Yp*, reference_wrapper::type>, _AllocT > _CntrlBlk; - __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), _AllocT()); + __cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT()); __enable_weak_this(__r.get(), __r.get()); } __r.release(); diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp @@ -49,6 +49,13 @@ template void assert_deleter ( T * ) { assert(false); } +namespace adl { +struct D { + void operator()(int *) const {} +}; +void ref(D); +} + int main(int, char**) { { @@ -98,5 +105,11 @@ } #endif + { + adl::D d; + std::unique_ptr u(nullptr, d); + std::shared_ptr s = std::move(u); + } + return 0; }