<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 - SFINAE using void_t causes a redefiniton error"
href="https://bugs.llvm.org/show_bug.cgi?id=46791">46791</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>SFINAE using void_t causes a redefiniton error
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>C++17
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>denizevrenci@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre><a href="https://godbolt.org/z/15ofMv">https://godbolt.org/z/15ofMv</a>
The source is as follows:
```
#include <array>
#include <type_traits>
template <typename T, typename = void>
struct indirectly_readable_traits {};
template <typename T>
struct indirectly_readable_traits<T*>
{
using value_type = std::remove_cv_t<T>;
};
template <typename T>
struct indirectly_readable_traits<T, std::void_t<typename T::value_type>>
{
using value_type = std::remove_cv_t<typename T::value_type>;
};
template <typename T>
struct indirectly_readable_traits<T, std::void_t<typename T::element_type>>
{
using value_type = std::remove_cv_t<typename T::element_type>;
};
static_assert(std::is_same_v<typename
indirectly_readable_traits<std::array<int, 5>>::value_type, int>);
```
This compiles both in GCC trunk and MSVC v19.24. Clang terminates compilation
with the following error: "redefinition of 'indirectly_readable_traits<T,
std::void_t<typename T::element_type>>'"</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>