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

    <tr>
        <th>Summary</th>
        <td>
            Clang frontend C++ crash when lambda returns array type with undeclared identifier
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </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/ba54GPKo1 (assertion-trunk)

```cpp
int main() {
    [&] <typename T>(T i) -> int[]
    { return 3; } (val);
}
```

Compiling the above code crashes clang `clang++ -x c++ `, crashes locally using clang-17.0 (a10019a), also on trunk with assertion (see godbolt link) 

Note that after the explicit return type `-> int[]` the program no longer crashes
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxck8FuszgQx59muIwSmYGEcODQJF_2sNJqD30BY0_AW2OztkmbffqVSdqvqhQFy5oxv_9vjIzRDI65g90RdudCLmn0oevDkqSN8iYHLnqv792rx38Xo97sHQPPwetFMVQvOKY0R6hegC5Al0Gp7eB1723a-jAAXf4DuvRyV__x95--RKCDjJFDMt5tUljcG1AL4gzi5fm_F4-fmufHjnEJJ2kc0AGoRWiOj31ExAxNe9idEapTus_s5MT4CtUvoMMrmtywgeoXGpceAb_1NkcMnJbgsILqiNCcM95N2oxUPd8CzfkH2Hfak59mY40bMI2Msvc3RuU1owoyjhxRWekGzHHyAugIdMTNB6rnMp9Hp69y65W09o5LzGeuPZuy2YrVWylE2coMRyeUNnr0DleH-G7SiF9ic3Vkxucg0JpVM34n_8snxjTKhPKaOKz8_DFbo0z61JKFZsIfBvdirZ6DH4Kc0Hm03g0cPlMUuqt0W7Wy4K7ct3Rom5KoGLsrNarRrKisFKv94VBTrVV51e2OWNRtYToSVIkD1WVTkhDbUlVEotRVv-uFFA3Ugidp7Nba25QvWGFiXLjb1-2eCit7tvHzJocuF236ZYhQC2tiir_bkkmWu9M6nWvwLrHTeHoOZc2B7yM7tHLqtXwKiShDkPeHl1X54jQrKwNrNJpdMlfDoViC7X58FiaNS79VfgK6ZIjnYzMH_w-rBHRZg0Sgy5rl_wAAAP__YvcZ0w">