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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Constraint normalization uses too much memory
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    ```
template <typename T>
concept C0 = true;

template <typename T>
concept C1 = true;

template <typename T>
concept C2 = true;

template <typename T>
concept C3 = true;

template <typename T>
concept C4 = true;

template <typename T>
concept X =
    (C0<T> && (C2<T> && C3<T>) || (C2<T> && C4<T>) || (C3<T> && C4<T>)) ||
    (C0<T> && (C1<T> && C2<T>) ||
     (C1<T> && (C1<T> && C3<T>) || (C1<T> && C4<T>) || (C3<T> && C4<T>)) ||
     (C2<T> && (C1<T> && C3<T>) || (C1<T> && C4<T>) || (C3<T> && C4<T>))) ||
    ((C2<T> && C3<T>) || (C2<T> && C4<T>) ||
     (C3<T> && C4<T>) && (C1<T> && C2<T>) ||
     (C1<T> && (C1<T> && C3<T>) || (C1<T> && C4<T>) || (C3<T> && C4<T>)) ||
     (C2<T> && (C1<T> && C3<T>) || (C1<T> && C4<T>) || (C3<T> && C4<T>)));

template <typename T>
concept Y = C0<T> && X<T>;

int foo(X auto x) { return 10; }
int foo(Y auto y) { return 20; }

int bar() { return foo(0); }
```
https://godbolt.org/z/d1e8z7vvK
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzslU-PmzAQxT_NcLE2sseYPwcOCSmXXnvYPRriDW4NjmwTNfvpKwir3U3oto226qUSEpL1e89vxuCR3ut9r1QBYgNiG8khtNYVjbXftPJBukft26i2u1MBCZ0fug6qOxgZFAFehtNB9bJT5AvwT0DXje0bdQikpAT4lgQ3KOAboOvf1bEbdXijjt-oi2_T3Y8yoGtCCAHMSgq8HBECmAAm0xperJV8XgDMCaQlpOUyFy9z_B3uBf1FKHZpglebzQ6L-KLFT-q64j6irsWO_YNUSw3_4EN_XfF7af4f71853j-6Dx6ma-Tqj7t_Nn320n0gj9YCZvdEDsGS7-dcG-JUGFxPGAW-IZBu38APZ_h0AeMreOZr6aYv8Q13NqHnop75V5OgDeHgga8BK8Bqb3e1NWFl3R6wegKsdkxlT-nx-DnaFXyX81xGqmApT0SaoUiitshrnmd1JoXM0xQzJmPkdc4pzXKepTyJdIEUBWWM0URQkaxqEWMjHmWeiYQltYCYqk5qszLm2I17R9r7QRUMUWQsMrJWxk8TDrExst8D4jjsXDEK7uph7yGmRvvgXyyCDmYai2eF2JLS9j44Obaqt66TRj_JoG1PBq88CdaSbmha0qnOulM0OFNcNEeHdqhXje0Aq3Gf-XV3cParagJgNeX2gNUc_VjgjwAAAP___snpow">