<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 - Cannot construct unique_ptr with pointer to incomplete type"
href="https://bugs.llvm.org/show_bug.cgi?id=39363">39363</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Cannot construct unique_ptr with pointer to incomplete type
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>zturner@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>eric@efcs.ca, llvm-bugs@lists.llvm.org, mclow.lists@gmail.com, mclow@qti.qualcomm.com
</td>
</tr></table>
<p>
<div>
<pre><a href="https://godbolt.org/z/a8ml4u">https://godbolt.org/z/a8ml4u</a>
#include <memory>
struct foo;
struct bar
{
// ok
std::unique_ptr<foo> a;
// ok
std::unique_ptr<foo> b{};
// not ok
std::unique_ptr<foo> c{nullptr};
};
According to <a href="http://eel.is/c++draft/unique.ptr#4.sentence-3">http://eel.is/c++draft/unique.ptr#4.sentence-3</a>, it should be ok
for the type to be incomplete. Since this is construction and not assignment,
it is not necessary to call delete and so we don't need to do a reset, hence we
shouldn't yet require a complete type.</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>