<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 --- - 3+ parameter common_type isn't sufficiently SFINAE-friendly"
href="https://llvm.org/bugs/show_bug.cgi?id=31481">31481</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>3+ parameter common_type isn't sufficiently SFINAE-friendly
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>rs2740@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#include <type_traits>
struct A {};
template class std::common_type<int, int, A>;
In file included from prog.cc:1:
/usr/local/llvm-head/include/c++/v1/type_traits:2029:8: error: no type named
'type' in 'std::__1::common_type<int, A>'
>::type type;
~~~^~~~
/usr/local/llvm-head/include/c++/v1/type_traits:2034:7: note: in instantiation
of template class 'std::__1::__common_type_impl<std::__1::__common_types<int,
int, A>, void>' requested here
: __common_type_impl<__common_types<_Tp, _Up, _Vp...> > {};
^
prog.cc:4:22: note: in instantiation of template class
'std::__1::common_type<int, int, A>' requested here
template struct std::common_type<int, int, A>;
^
The __void_t check for this case only verified the existence of
common_type<_Tp, _Up>::type, not common_type<typename common_type<_Tp,
_Up>::type, _Vp...>::type. The simplest fix is to inherit from
common_type<typename common_type<_Tp, _Up>::type, _Vp...> instead.
Of course, P0435R1 is touching this area again, but the principal change is to
the two-parameter version and not >2, so figured I'd file this anyway.</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>