<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60435>60435</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
one case gcc can compile, but clang will fail to compile
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
4465464
</td>
</tr>
</table>
<pre>
#include <stdio.h>
#include <type_traits>
template <typename T>
constexpr inline bool is_nested(){
return std::is_same_v<T,int>;
}
template<template <typename> class hash_function>
int device_hasher(){
return 0;
}
template <typename Key, std::enable_if_t<(not is_nested<Key>())>* = nullptr>
struct SparkMurmurHash3_32{
using result_type = int;
constexpr SparkMurmurHash3_32()=default;
[[nodiscard]] result_type inline operator()(Key const& key) const{
return compute(key);
}
};
int main(){
device_hasher<SparkMurmurHash3_32>();
return 0;
}
<source>:27:5: error: no matching function for call to 'device_hasher'
device_hasher<SparkMurmurHash3_32>();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:11:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'hash_function'
int device_hasher(){
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyklD2P4zgPxz-N0ggT2JJfCxeeZIIHWDzVbW_IMmPrVpYMiZrdNPfZD_IkzmSRxRSXwrEhUvyR_JPCezUagIbkryQ_7kTAybomy4o8K7Jdb4dLQxhXRuowACX84HFQdj8R_kaSI0nax1O8LNChEwr93WJ9IsyLFrhZGTED_b4ZSWs8wq_FUWW0MkB7azVVvjPgEQbCKsJqUr5-WFNKqQMMzlCPA-Et4a3ynRczdO-EH74TdlAG4-386kLK4zOcSPOEjPA3KrXwnk7CT905GInKmg1XGaQDvCsJXTQA92fA5CuEh4p8gwthh3tWYESvoVPnDgk_EFYZi5_Kwg_Rgb9dw7N6fW8p4UdqgtYLuo3ZowsS6V-LcD_-H9wc3P-En3jH2QN28MqM1IEPGrvItV62VvP1M360vXft2a0fTPw4wFkE_cx_Vd2rsYPyUriB5EeSHx9i3-RgF3AC7a3OrPoGl4_whBX0R6xaff3-nMynPkg7LwGBsOrDesOh976Ux98gY59nocyT9j62nx-eVWBrzBbrK1E8PPnB2-AkrDpuWUl4mxPeUnDOuvhiLJ0Fyil27KZReraOSqE1RUsJK3-TaflfMyD52z9f_Z7yp-mN39g4eC2VwgxqiCOwzYIajXVR2C1V5l1oNVD4tWglFerLi19AqrOCgQo3hhkMrtlu3otwYgYEFxN_nNxb4n-e3N3Q8KHmtdhBkxZlztKqqPhuampZ9VCJIoUik0NVZ-c-FyKTLBnSImV8pxqWMJ6wJE0YTxnfMy5YX5dVehZ9XfY9yRKYhdJ7rd_nvXXjTnkfoCmSjOc7LXrQfl3BjBn4SddDwljcyK6JPi99GD3JEq08-vstqFBDYw1QKTzQUcpY01XqSkNcJH3AuMjMSH8qrelZqFUXV4tdcLqZEBcftw07EXYaFU6h30s7E3aKga5_L4uzf4NEwk4rnifstOL_GwAA__-cNO7y">