[LLVMbugs] [Bug 18853] New: tuple with unique_ptr element cannot be emplaced in vector (c++1y)
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Feb 15 13:29:50 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=18853
Bug ID: 18853
Summary: tuple with unique_ptr element cannot be emplaced in
vector (c++1y)
Product: libc++
Version: 3.4
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: hhinnant at apple.com
Reporter: flo at chilicode.com
CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
Classification: Unclassified
Created attachment 12068
--> http://llvm.org/bugs/attachment.cgi?id=12068&action=edit
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140215/32681e99/attachment.html>
More information about the llvm-bugs
mailing list