<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 --- - tuple<A> is_constructible attempts tuple<A> to A conversion"
href="https://llvm.org/bugs/show_bug.cgi?id=23256">23256</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>tuple<A> is_constructible attempts tuple<A> to A conversion
</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>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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eugeni.stepanov@gmail.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>I'm not sure this is a bug, but...
std::is_trivially_copy_constructible<std::tuple<A>>::value instantiates A's
type conversion constructor with tuple<A> as an argument. Is it allowed to do
that?
#include <tuple>
class A {
public:
A() : value_(0) {}
template <typename T>
explicit constexpr A(T value)
: value_(static_cast<int>(value)) {}
private:
int value_;
};
A a;
A b(a);
static_assert(std::is_trivially_copy_constructible<std::tuple<A>>::value,
"zz");
$ ./bin/clang++ ../1.cc -c -std=c++11 -stdlib=libc++
../1.cc:9:16: error: cannot convert 'std::__1::tuple<A>' to 'int' without a
conversion operator
: value_(static_cast<int>(value)) {}
^~~~~~~~~~~~~~~~~~~~~~~
/code/llvm/build/bin/../include/c++/v1/type_traits:2356:38: note: in
instantiation of function template specialization
'A::A<std::__1::tuple<A> >' requested here
: public integral_constant<bool, __is_constructible(_Tp, _Args...)>
^
/code/llvm/build/bin/../include/c++/v1/__tuple:303:32: note: in instantiation
of template class
'std::__1::is_constructible<A, const std::__1::tuple<A> &>' requested
here
is_constructible<_Up0, _Tp0>::value &&
^
/code/llvm/build/bin/../include/c++/v1/__tuple:315:12: note: in instantiation
of template class
'std::__1::__tuple_constructible_imp<std::__1::__tuple_types<const
std::__1::tuple<A> &>,
std::__1::__tuple_types<A> >' requested here
: public __tuple_constructible_imp<
^
/code/llvm/build/bin/../include/c++/v1/__tuple:328:14: note: in instantiation
of template class
'std::__1::__tuple_constructible_apply<true, std::__1::tuple<const
std::__1::tuple<A> &>,
std::__1::__tuple_types<A> >' requested here
: public __tuple_constructible_apply<tuple_size<typename
remove_reference<_Tp>::type>::value ==
^
/code/llvm/build/bin/../include/c++/v1/tuple:583:26: note: in instantiation of
template class
'std::__1::__tuple_constructible<std::__1::tuple<const std::__1::tuple<A>
&>, std::__1::__tuple_types<A>, true,
true>' requested here
__tuple_constructible
^
/code/llvm/build/bin/../include/c++/v1/tuple:610:9: note: while substituting
prior template arguments into non-type
template parameter [with _Up = <const std::__1::tuple<A> &>]
tuple(_Up&&... __u)
^~~~~
/code/llvm/build/bin/../include/c++/v1/type_traits:2689:31: note: while
substituting deduced template arguments into
function template 'tuple' [with _Up = <const std::__1::tuple<A> &>, $1 =
(no value)]
: integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)>
^
/code/llvm/build/bin/../include/c++/v1/type_traits:2817:14: note: in
instantiation of template class
'std::__1::is_trivially_constructible<std::__1::tuple<A>, const
std::__1::tuple<A> &>' requested here
: public is_trivially_constructible<_Tp, typename
add_lvalue_reference<const _Tp>::type>
^
../1.cc:18:20: note: in instantiation of template class
'std::__1::is_trivially_copy_constructible<std::__1::tuple<A> >'
requested here
static_assert(std::is_trivially_copy_constructible<std::tuple<A>>::value,
"zz");</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>