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

    <tr>
        <th>Summary</th>
        <td>
            Clang frontend C++ crash on redefinition of monostate
        </td>
    </tr>

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

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

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

<pre>
    To quickly reproduce: https://gcc.godbolt.org/z/674v445Tr (assertion-trunk)

```cpp
#include <variant>

struct State{};
namespace std
{
    template<>
    struct monostate {};
}

int main()
{
    std::variant<std::monostate, State> v;
    return 0;
}
```

Compiling the above code crashes clang `clang++ -x c++`, crashes locally using clang-17.0 (a10019a), also on trunk with assertion (see godbolt link)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU1FyqzoMXY340SRj7ADhg4-ENht43YAxCvjV2DzbpK939XdMuTTTuTOZoJF8jqQjSYagB0vUQHGF4iWTSxydbzq_RGmCfMiBss71n82bw_8Wrd7NJ3qavesXRSAuOMY4BxAX4Dfgt0Gp4-D6zpl4dH4AfvsF_FZWp8fpVLx5BH6WIZCP2tlD9It9B14DewF22f5L9vVT87x5uNBWmaUnBNE-pNfSRhCvz6gQ_aIi_hNlJKiuUL2AuH6FrJwozFIRhthvmGqLISJGmmaTYKLdSZN_o5ycdSHR4g_eZD9VoG3ESWoL_Pzd0XOelF1cQFz2DtrdtScB3m5NiFd87LkS3lNcvEX2lwL-SPZcT-umWRttB4wjoezcg1C5nlB5GUYKqIy0AyahkwH8CvyKh_9RfZmJjrf7a-OUNOYTl5AoV8ghr45sHWjOWF7L1DZvUZrg0Flch4sfOo64Tzy9DkS4bQgavc4_6xvR16KWGTV5eS6LnLGyzsaGlyxXZVHWZc8kdTI_Kyq6nrP6JOWpKjLdcMYFK_M8r1nO6mNV9oWqi3vOi5J39R1OjCapzdGYx5Q2MtMhLNSUghcsM7IjE9bV59zSB65B4Dxdgm8S5tAtQ4ATMzrE8M0SdTTUtKuGd-9sJNtju6m4ipY08NTTXVu99u7u38uULd40Py5Hx3HpjspNwG8pz_Y5zN79SyoCv63VhXRPqfrfAQAA__8T0B90">