From 7e698523da09ccaa22be62fefad92133bd7ec87c Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Mon, 17 Apr 2017 20:20:27 +0000 Subject: [PATCH] Fix passing incorrectly value-category when constructing unique_ptr's deleter git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300489 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/memory | 2 +- .../unique.ptr.ctor/move_convert.pass.cpp | 103 +++++++++++++++++- 2 files changed, 100 insertions(+), 5 deletions(-) diff --git a/include/memory b/include/memory index 44a0c34e4..87484a1fe 100644 --- a/include/memory +++ b/include/memory @@ -2734,7 +2734,7 @@ public: > _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept - : __ptr_(__u.release(), _VSTD::forward(__u.get_deleter())) { + : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) { } template #include "test_macros.h" +#include "type_id.h" #include "unique_ptr_test_helper.h" template @@ -33,9 +34,71 @@ struct GenericConvertingDeleter { void operator()(void*) const {} }; +template +struct is_specialization; + +template