<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63463>63463</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            SFINAE failed if name of structure and typedef is same
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          raidenluikang
      </td>
    </tr>
</table>

<pre>
    See [example](https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAMzwBtMA7AQwFtMQByARg9KtQYEAysib0QXACx8BBAKoBnTAAUAHpwAMvAFYTStJg1DIApACYAQuYukl9ZATwDKjdAGFUtAK4sGIMwBspK4AMngMmAByPgBGmMT%2BXKQADqgKhE4MHt6%2B/kGp6Y4CYRHRLHEJZkl2mA6ZQgRMxATZPn6Btpj2RQwNTQQlUbHxibaNza25HQrjA%2BFD5SNVAJS2qF7EyOwcJhoAgrsH%2B%2BYAzOHI3lgA1CYnbgQAnsmYAPoExEyECrfYh3/H%2B2YbAUySYWyuLAULD%2BAHYrPsZsQvA4rjMmARXjEmEpYfC9lcCVcMSxkgYMTc7o9nkDMFdsAA3RgEUhEp6MVi0gBiQgAsj9DoSrvTUHh0FcBC8mcQHhA0AwZnTGYIboErizuXzVcsTHCdQARAWEw0E4mk9G0273Nk0xVMllU9lsK4a/n7QXC0XihiS1SEWUCBUMpkqgJq5288yh5Y3XUwg3HOO3PGHRHIgioxoYl4Adzo6FExHQICuyS8MVoeGQGfNLyxOITeMFDqwVCu4XTudo%2Baa6CTsINJ2TgI5ILBtKwjTo3wbxqJmBJZItlOtHKuABV7SundgKXqhSLeycd6mUXgFDm8wX0G9MDMXggus8EiWyxWqzMiyAqGIlG82TqrETQdZ1NRcKStalVzXH4MyRU9z07btCxvO8H1oJ9LQ3DNPw9a8CEtB0bTXEAQEQq8YJg4tS3LStsJI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YFyLvYkuZcK5K1sTXexLdhCiHEM3Ou8glBqENroMw%2BhQ591XgPTOI9OHj0npwGec8F4EEPMvfuFh16b3iDvLA3SD5fyPn4E%2BDB3D/1yBfZZcDFgQJSM/Ho0CdmFEyJsm%2Bn9uj1Cgas8%2BnQzk/1mMcj%2BYx%2Bj7LRM0e5EDEEbGQVwP6aDSAKIZpwLBuD8GEOMUYK4EAGLmOjJQ/ARBiC0O%2BQw9mLDMBsJGJw6mtNSCyPkYbJRtgVFszRswrh/g8ZExOBoImktJAaBhNgomAMAgaBOFIk46DFGcGRSSjR3NNEQCQOsAgpZmT6O0boyIHJOA4LwQQq4YLgBXC4CcXGGg1W8EwHCkgoo9B1IbjU6QdS26NM7nobMHxkjFykUDP5%2BLOAq2TqK8UrZZUgqISQ5V6qKEeEMQi04SLiVMNReijhPzpE4pAHIu1GDuWEtUezPl8BBUgGFaKoWBidFiylWwGVwL5WKohVCjG9DgjaumXq2QBqm5GtkCajuYNmmkAtUwK1hSbWcoBRwR1Irk4uqBXK0FPclWQrMSWiFvqs3xFoWYUtajSWsPYZQTG/gia4wBjjHhkht0AwJicQRVNODYtxTGrlTN41BvRmSswkhcZUqRtgyQ2CTiExhGYGElL2WdvBnG%2Bd4azDfoJX%2B0gW90jOEkEAA)
 
 
 if change  `int wildcard`   to   `int wildcard_t`   works fine. [source](https://godbolt.org/z/oeYKPz6sG)

source code

```
#include <type_traits>

namespace msm
{
struct state_base
{
    template <typename Event, typename FSM>
    void on_entry(const Event & , FSM& ){}
    
    template <typename Event, typename FSM>
    void on_exit(const Event & , FSM& ) {}
};

struct state_wildcard: public state_base
{
    typedef int wildcard_t; // if typedef name is wildcard  CLang failed.
};

namespace details
{
    template <typename T, typename E = void> struct is_wildcard_test_helper: public std::false_type{};
    template <typename T> struct is_wildcard_test_helper<T, std::void_t<typename T::wildcard_t> > : public std::true_type{};
}

template <typename T> struct is_wildcard_test: public details::is_wildcard_test_helper<T>{};

struct my_wildcard: public state_wildcard{

};
struct non_wildcard{};

static_assert(is_wildcard_test<my_wildcard>::value, "!");
static_assert(!is_wildcard_test<non_wildcard>::value, "!");
} // namespace msm


namespace state
{
    struct wildcard: public msm::state_wildcard{}; // Clang failed here

 
}

static_assert(msm::is_wildcard_test<::state::wildcard>::value, "!");
int main(){
     
    
}

```
 
 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysWFmTokyz_jX0jfFNIJtw0RdVUGyCyqIsNxMIWCCbbCL--hPaPT3d8_Z33jkRJ6KbpaoynyefzMoijPo-x3WavhIsJFjpJRqHrOleuyhP0roc8yKq8cuxSeZXJ00XBAvTW1RdypRgJYLis2G49AQNCEomKBk3ybEphx9Nh58D9J2gwTYwcAZk2CasJd5AMO0CaIoVtBNoAHlpiTGIdkgE5n2CgwlWwJrkwbTgDGwsrAcrQGDu8yNp-UC88RCCdQNrF4A9UC8TMK9ADlxn0PFS0sAFiAGwxmAsSiEE7iStzwlQ5P0A1kyvaOYE-8uaAWaNzQrAeYehUpkuQbEU9NcWkFq8zhBjqgP3HCMouVAuXMCIga3ahor0sCipCnChhW3zBtxwV3NwuJwp25o2rmWV-6N6y4_R5h5RrGp1Z_D0I0usszkA3aFaeYXm7RTrWQNw16vvMCwFA3DfqhpdYrAUg_qILVD3VQB2DbqhGYndKchogpLfLKjgCPazE3jzaIC9IT0HgRp0uz7srStgurNZAds_owpdgpMolLF4iE3nVuDAdONVI9SFZMpJDwBtY7TP0IUzDzmJYW5h0J8FqXG6q7tXM1KOochXsaVmgARTWLtKoB0b1OX30b8f4t5VxcQCNvDQRCKmKgSFpFb0piBvB7Ms90LZr5mIoOR6Zfki6edZ7iwd5O1FuDcvRYv1lqV4fs7YgPb3E6bV7ZbeKaqtajhvbk1QMiC5N5yMbqqliePs8OahSRVLOW2M-bbV3NSUpXY6iCPju2PSPKWIIk50e22jUy7WWM2Aw3o6uw09HW-tXkE91IZyO6jrEcDDyhnrBK_9NnOMdI4Trtr7WJYqfvJJRTAl08d47HmUe_P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