<html>
<head>
<base href="http://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 --- - tuple with unique_ptr element cannot be emplaced in vector (c++1y)"
href="http://llvm.org/bugs/show_bug.cgi?id=18853">18853</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>tuple with unique_ptr element cannot be emplaced in vector (c++1y)
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</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>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>hhinnant@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>flo@chilicode.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=12068" name="attach_12068" title="test case">attachment 12068</a> <a href="attachment.cgi?id=12068&action=edit" title="test case">[details]</a></span>
test case
found a similar bug with pair, but the proposed workaround didn't help.
clang++ -std=c++1y -stdlib=libc++ tupletest.cpp -lc++abi
In file included from tupletest.cpp:3:
In file included from /usr/include/c++/v1/vector:265:
In file included from /usr/include/c++/v1/__bit_reference:15:
In file included from /usr/include/c++/v1/algorithm:627:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:267:11: error: call to implicitly-deleted copy
constructor of 'std::__1::unique_ptr<Data, std::__1::default_delete<Data> >'
: value(__t.get())
^ ~~~~~~~~~
/usr/include/c++/v1/tuple:460:5: note: in instantiation of member function
'std::__1::__tuple_leaf<2, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> >, false>::__tuple_leaf' requested here
__tuple_impl(const __tuple_impl&) = default;
^
/usr/include/c++/v1/type_traits:1984:1: note: while substituting deduced
template arguments into function template '__is_constructible_test' [with _Tp
= std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > >, _Args = <std::__1::tuple<int, int,
std::__1::unique_ptr<Data, std::__1::default_delete<Data> > > &>]
__is_constructible_test(_Tp&&, _Args&& ...);
^
/usr/include/c++/v1/type_traits:2043:14: note: in instantiation of template
class 'std::__1::__is_constructible<false, std::__1::tuple<int, int,
std::__1::unique_ptr<Data, std::__1::default_delete<Data> > >,
std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > > &>' requested here
: public __is_constructible<is_scalar<_Tp>::value ||
is_reference<_Tp>::value,
^
/usr/include/c++/v1/type_traits:2069:14: note: in instantiation of template
class 'std::__1::__is_constructible_void_check<false, std::__1::tuple<int,
int, std::__1::unique_ptr<Data, std::__1::default_delete<Data> > >,
std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > > &>' requested here
: public __is_constructible_void_check<__contains_void<_Tp,
_Args...>::value
^
/usr/include/c++/v1/type_traits:2290:14: note: in instantiation of template
class 'std::__1::is_constructible<std::__1::tuple<int, int,
std::__1::unique_ptr<Data, std::__1::default_delete<Data> > >,
std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > > &>' requested here
: public is_constructible<_Tp, const typename
add_lvalue_reference<_Tp>::type>
^
/usr/include/c++/v1/utility:228:51: note: (skipping 1 context in backtrace; use
-ftemplate-backtrace-limit=0 to see all)
!is_nothrow_move_constructible<_Tp>::value &&
is_copy_constructible<_Tp>::value,
^
/usr/include/c++/v1/utility:235:1: note: while substituting deduced template
arguments into function template 'move_if_noexcept' [with _Tp =
std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > >]
move_if_noexcept(_Tp& __x) _NOEXCEPT
^
/usr/include/c++/v1/vector:839:21: note: in instantiation of function template
specialization
'std::__1::allocator_traits<std::__1::allocator<std::__1::tuple<int, int,
std::__1::unique_ptr<Data, std::__1::default_delete<Data> > > >
>::__construct_backward<std::__1::tuple<int, int,
std::__1::unique_ptr<Data, std::__1::default_delete<Data> > > *>' requested
here
__alloc_traits::__construct_backward(this->__alloc(), this->__begin_,
this->__end_, __v.__begin_);
^
/usr/include/c++/v1/vector:1576:5: note: in instantiation of member function
'std::__1::vector<std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > >,
std::__1::allocator<std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > > >
>::__swap_out_circular_buffer' requested here
__swap_out_circular_buffer(__v);
^
/usr/include/c++/v1/vector:1593:9: note: in instantiation of function template
specialization 'std::__1::vector<std::__1::tuple<int, int,
std::__1::unique_ptr<Data, std::__1::default_delete<Data> > >,
std::__1::allocator<std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > > > >::__emplace_back_slow_path<int,
int, std::__1::unique_ptr<Data, std::__1::default_delete<Data> > >'
requested here
__emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);
^
tupletest.cpp:27:10: note: in instantiation of function template specialization
'std::__1::vector<std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > >,
std::__1::allocator<std::__1::tuple<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > > >
>::emplace_back<int, int, std::__1::unique_ptr<Data,
std::__1::default_delete<Data> > >' requested here
list.emplace_back(0, 0, std::unique_ptr<Data>(new Data()));
^
/usr/include/c++/v1/memory:2510:31: note: copy constructor is implicitly
deleted because 'unique_ptr<Data, std::__1::default_delete<Data> >' has a
user-declared move constructor
_LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
^
1 error generated.
-----
clang++ -std=c++11 -stdlib=libc++ tupletest.cpp -lc++abi
compiles.
clang-3.4 and libc++ 3.4 on arch linux.</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>