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

    <tr>
        <th>Summary</th>
        <td>
            Clang front-end crash when lambda-capturing result of invalid structured binding
        </td>
    </tr>

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

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

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

<pre>
    clang front-end crashes when lambda-capturing result of invalid structured binding.

Steps To Reproduce:

// test.cpp
void crash() {
 const int &[a, b] = {0, 0};
    auto x = [b]() -> int {
 return b;
    };
}

// $ clang++ -std=gnu++17 -c test.cpp

Results:
Diagnostic output correctly reflects that program is invalid but the front-end also crashes.
https://godbolt.org/z/EfTbh1zKP 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykUs1ynDgQfprm0sUUiL_hwMFjzGUvW16_gJAEaEsjUVLLyfjpU8DYcZzcchFUq_V1fz88BD1bpTqoLlD1CY-0ON9NfOHS8tuN-2R08tYJw-2Mk3eWUmUlCs_DogJ-W5RFw6-j5KngK0Wv7YxehWgI3YTavnKjJQbyUVD0SuKordR2PkHWQ_ZwnP-RWgO-OHxWq3cyCgXFw-cGYAOwAUkFOol1PYqvTt83AXYG1iI0l-MGhbOBUFtCYDVUFw7sEUeoeoSi3_qyrZBB00Px_gYReSSH34-e6rL135FTKJ4OuI8RXlH0FsdfAD4Dbv-_UwBW4q4msAuwC6aBJBT9bONRyBtMxReix_m8qxo-lOk1n60LpAW6SGskFM57Jcjc0KvJKEEBaeGEq3ez51fU4cOQMRLSoj5Zyk1w777ezVmI1n3evvrs5OgMnZyfgQ1vwIan6WVc8rd__sVEdoVsi5Ynqsvrtm2LrGZZsnSFPNfy3KqqaEQ9lQ2XFW8b1Z5LkVfNWSW6Yxkr8jwvM1bVVXOauMwbMYoql3ktywbKTF25NidjXq_b8ESHEFXXsLw9J4aPyoQ9vowduhYPOyllJTC2hdp329N0jHOAMjM6UPgJRpqM6h7_lO-_SHcSvem-yKdpieNJuCuwYRt__6Srd_8rQcCGnVgANuzcfgQAAP__mwMfCw">