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

    <tr>
        <th>Summary</th>
        <td>
            [Front-end] crash 
        </td>
    </tr>

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

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

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

<pre>
    The following code makes clang to crash. See [at godbolt](https://godbolt.org/z/4q6co9Gae).

```
template<int N>
struct A {
    template<class C>
    friend auto cica(const A<N-1>&, C) {
        return N-1;
    }
};

template<>
struct A<0> {
    template<class C>
    friend auto cica(const A<0>&, C);
};

template <int N, class AT, class = decltype(cica(AT{}, nullptr))>
static constexpr bool MakeCica(int);

template <int N, class AT>
static constexpr bool MakeCica(short, A<N+1> = {});

template <int N, class AT = A<N>, class Val = decltype(MakeCica<N, AT>(0))>
static constexpr bool has_cica = Val{};

constexpr bool cica2 = has_cica<0> || has_cica<0>;
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytlEuP2yAQgH8NvqBYGL_igw-J0_TUvXTVa4UxiWmJcQF3u_31HbCTbLKqlEq1cAzz_BiYtLp7rZ97gQ9aKf0ihyPmuhP4xL4Li7liIHAac8NsH-PPQmCUb5nDR921WjmU7xBd986NFqUbRPcwFlWszRFWv-HNfhRcVx-ZQLSKEdkhsll-C7KMsHTiNCrmBEobOTj8hNIPs8I6M3GHNxiV21mC4XljDqDW4ubi4NUHI8XQYTZ5fskZgHI9WAgDDk-rxBvTAtEG_Gh1G9o_RrjJDDhYvlGhcrfAw-SseMf_Dh1kBIT_bwfklv-K8lcsfKkr-Mz5Ns_XOUp3uBNcuddR-ExzQrAAYogJdsOk1OiMz-YTXnbInOQ4kIlfo8Gt1gp_ggvUzCEg5w3gA1APx7a9Ns67hkNFdJuEIsNWztj_lDh4zqF8dc-KL0zdl-fCENI2CzRdk4eq0zP71Rc4RIXoC-wt6Z2Pt6fB4ex9vVMNjHvxNdq5y6KuTrsqrVjkpFOihlbeGz24Fdwy6OS5y3E0GVXftbR0_dTGXJ9godTP82c1Gv1NcDiAvbR2EhYmeZ6TKurrNaMs6ciap1l3aCkXvK2yPE-TrkiKJDlEirVCWQ-BKB3ECw4hYA4okawpoZTkiTfOaBmLQ8ZKQousKEFScpQRcWJSxZ7D_9dEpg5I7XS0oFTSOntVwinK4yDCnn186Cm4ObXlPZtObRRS1wH9D8grd0U">