<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 - vector.resize failed to compile if move constructor is deleted with c++17"
href="https://bugs.llvm.org/show_bug.cgi?id=47892">47892</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>vector.resize failed to compile if move constructor is deleted with c++17
</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>All
</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>yichen.yan@inf.ethz.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>root@834982c35017:/# /llvm-install/bin/clang++ --version
clang version 12.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
f2e08c688e6c3223d14c4817c5ce0b55c03a8d1b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /llvm-install/bin
root@834982c35017:/# /llvm-install/bin/clang++ --std=c++17 -o /dev/null -c
test.cc
root@834982c35017:/# /llvm-install/bin/clang++ --std=c++17 -stdlib=libc++ -o
/dev/null -c test.cc
In file included from test.cc:1:
In file included from /llvm-install/bin/../include/c++/v1/vector:276:
In file included from /llvm-install/bin/../include/c++/v1/__bit_reference:15:
In file included from /llvm-install/bin/../include/c++/v1/algorithm:643:
/llvm-install/bin/../include/c++/v1/memory:1634:13: error: static_assert failed
due to requirement '__is_cpp17_move_insertable<std::__1::allocator<S>,
false>::value' "The specified type does not meet the requirements of
Cpp17MoveInsertable"
static_assert(__is_cpp17_move_insertable<allocator_type>::value,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/llvm-install/bin/../include/c++/v1/vector:954:21: note: in instantiation of
function template specialization
'std::__1::allocator_traits<std::__1::allocator<S>>::__construct_backward_with_exception_guarantees<S
*>' requested here
__alloc_traits::__construct_backward_with_exception_guarantees(
^
/llvm-install/bin/../include/c++/v1/vector:1098:9: note: in instantiation of
member function 'std::__1::vector<S,
std::__1::allocator<S>>::__swap_out_circular_buffer' requested here
__swap_out_circular_buffer(__v);
^
/llvm-install/bin/../include/c++/v1/vector:2027:15: note: in instantiation of
member function 'std::__1::vector<S, std::__1::allocator<S>>::__append'
requested here
this->__append(__sz - __cs);
^
test.cc:12:5: note: in instantiation of member function 'std::__1::vector<S,
std::__1::allocator<S>>::resize' requested here
v.resize(1);
^
1 error generated.
root@834982c35017:/# cat test.cc
#include <vector>
class S {
public:
S();
S(const S &);
S(S &&) = delete;
};
int main() {
std::vector < S > v;
v.resize(1);
return 0;
}</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>