<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - shared_ptr cannot be constructed with a move-only deleter"
href="https://bugs.llvm.org/show_bug.cgi?id=37637">37637</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>shared_ptr cannot be constructed with a move-only deleter
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>anthony@justsoftwaresolutions.co.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=20363" name="attach_20363" title="Sample file that demonstrates the bug">attachment 20363</a> <a href="attachment.cgi?id=20363&action=edit" title="Sample file that demonstrates the bug">[details]</a></span>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>