<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - list::remove should not require allocator to have default constructor"
href="https://llvm.org/bugs/show_bug.cgi?id=31378">31378</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>list::remove should not require allocator to have default constructor
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</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>lukasl@ca.ibm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The current libc++ implementation of `std::list::remove` uses the default
constructor of `std::list`:
<span class="quote">> list<_Tp, _Alloc> __deleted_nodes; // collect the nodes we're removing</span >
This subsequently calls the default constructor of `_Alloc`. However, reading
through section 17.6.3.5 ("Allocator requirements") of the C++11 standard
draft, it appears allocators are not required to be DefaultConstructable.
I believe the constructor of `__deleted_nodes` should simply be given the
allocator instance of the existing list:
<span class="quote">> list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing</span ></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>