<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/117654>117654</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Distinct template specializations result in redefinition error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidmatson
</td>
</tr>
</table>
<pre>
```c++
// © Microsoft Corporation. All rights reserved.
#include <type_traits>
#include <utility>
namespace async::details
{
template <typename T, typename = std::void_t<void, void>>
struct co_await_operator_or_self final
{
using type = T;
};
template <typename T>
struct co_await_operator_or_self<T, std::void_t<decltype(std::declval<T>().operator co_await()), void>> final
{
using type = decltype(std::declval<T>().operator co_await());
};
template <typename T>
struct co_await_operator_or_self<T, std::void_t<void, decltype(operator co_await(std::declval<T>()))>> final
{
using type = decltype(operator co_await(std::declval<T>()));
};
template <typename T>
using co_await_t = typename co_await_operator_or_self<T>::type;
template <typename T>
struct awaitable_resume final
{
using type = decltype(std::declval<co_await_t<T>>().await_resume());
};
}
namespace async
{
template <typename T>
using awaitable_resume_t = typename details::awaitable_resume<T>::type;
}
```
https://godbolt.org/z/KM9xEd6q6
The above code complies on both MSVC and GCC.
The code above is from the cpp-async project (see [microsoft/cppasync#20](https://github.com/microsoft/cpp-async/issues/20)).
Is the above code valid, or are MSVC and GCC mistaken to accept it?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU1v4zYQ_TXUZRBDJiPZOujgyFFRFDk16NWgxJHNlhJVcuRt9tcXpPyRerdGECywBmFZ5Hy894aekd7r_YBYsuyJZdtETnSwrlTyqFUvydshaax6K1mezqtl_CmsdMN4zXgNrOJsU8CLbp31tiOorButk6TtsICNMeD0_kAeHHp0R1SL4BvchR5aMykEJip6G3FHTmryTDx_czyRNpreTkfpZpA9-lG2CNK_DS0TGyY2Cklq44PFKgAEACDsRyPpkiM4wivjFVzemNiCJzXHOFqtdsREFX4Es_gUz3PmENGTm1qC1u7kF6lpZ0d0kqzbWbfzaDro9CDNyfgKJHwmr4d9TByTvjLxdLHbzi_3YX8YBBNVJPktL4WtCREZX18Ow95RmugknhlfM14sziEvSeb9uN7L8nG-PyL1T1DsfBPewf8ewLuUzug_LdinM35WrxnKRS6KgC6G92UMNAOuiP0TRYqhZWNw59BPPf6oK3Zlc4F5vnLz_pzu7m1bbb_fgT7QdG60vWV5q_G5nUUSt8b_p_MM79ysZ6gHojGGiQ17b1VjDS2s2zNef2W8_u2l-OdZ5X_ns_nrAUE29hiqrMJXPxqNHuwAjaUDvPz-RwVyUPBLVS2uLtF49tMeOmd7oLA9jg9RIRid_RNbglAbRGDZU3-eGYzX7TjOQnLBU5ZtGV_f4NZ0mJpFa3vG6xvPh5Nrrb2f0DNe83Qu4Qngrz6CeUfrKM38t7YOpMP_sIJee5J_4QBkQbYtjgSamKgTVQpViEImWC5XgmdrnnGRHMoiy7lq827d5MsubXiXF6JdNitc5plouEh0yVP-uFzyPE2zjPMFykwUnVRp-siLYt2xxxR7qc3CmGMfipNELuVyucqzx8TIBo2PU5rzAb9APGWch6HtyuD00Ex7zx5Toz35axjSZLDcak96aOl6N_2IrZZGf42TOo7nyRDoARwq7PSgwz6gc9YlkzPlnXKEZKfHw6nM74tx4nAs-b8BAAD__4Tmm7I">