https://bugs.llvm.org/show_bug.cgi?id=37637
Bug ID: 37637
Summary: shared_ptr cannot be constructed with a move-only
deleter
Product: libc++
Version: 5.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: anth...@justsoftwaresolutions.co.uk
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
Created attachment 20363
--> https://bugs.llvm.org/attachment.cgi?id=20363&action=edit
Sample file that demonstrates the bug
Compiling the attached file with the below command fails with the error message
below. This should work, as per [util.smartptr.shared.const]p9/13
Compilation succeeds as expected with -stdlib=libstdc++
clang++-5.0 -std=c++17 -stdlib=libc++ move-only-deleter.cpp
In file included from move-only-deleter.cpp:1:
/usr/include/c++/v1/memory:3981:39: error: call to deleted constructor of
'Deleter'
__cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
^~~
move-only-deleter.cpp:17:5: note: in instantiation of function template
specialization 'std::__1::shared_ptr<int>::shared_ptr<int, Deleter>' requested
here
std::shared_ptr<int>(new int,Deleter());
^
move-only-deleter.cpp:6:5: note: 'Deleter' has been explicitly marked deleted
here
Deleter(Deleter const&)=delete;
^
/usr/include/c++/v1/memory:3507:39: note: passing argument to parameter '__d'
here
__shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
^
1 error generated.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs