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

    <tr>
        <th>Summary</th>
        <td>
            Interp crashing on nested `ArrayInitLoopExpr`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            crash-on-valid
      </td>
    </tr>

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

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

<pre>
    The following snippet causes a crash in `Interp`.

```c++
struct X {
 int x;
};

constexpr int foo() {
  X arr[2][2] = {1, 2, 3, 4};

  auto [a, b] = arr;

  return 0;
}

static_assert(!foo(), "");
```
```
clang++: /root/llvm-project/clang/lib/AST/Interp/ByteCodeExprGen.cpp:2671: bool clang::interp::ByteCodeExprGen<Emitter>::emitRecordDestruction(const clang::interp::Descriptor*) [with Emitter = clang::interp::ByteCodeEmitter]: Assertion `ElemRecord' failed.
```

See the full stack trace on [godbolt](https://godbolt.org/z/7v6KK8716).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVMGO3CgQ_ZryBU3LhsZtH3xwj9urKHva5JDbCuPqbjY0WFCezOzXr6A9O9lJVpFQ2eCqx-PVMypGc3GIHcgjyKFQK1196Exc9VdFOhaTn1-6z1dkZ2-t_2bchUVnlgWJabVGjEwxHVS8MuMY1OUHRxgWqMsdlAOU_Rbr8j408GMaeTVSWDWxLwwO2wozjtgziG0Kh-HtPUftXSR8XkLOPHsPvAHefofAvjAVAsgjBzlsDwZiSCkV8EfGUxAp7H_EZ0yt5BnIo0oZ02txgnyfGZDW4Fj5H7rfZURSZPSfKkYMlHlW_xJO4MB5Hu0bwKtMP51qq9xl00_0DPgYvCfgo7VPt4cl-L9Qp-mWN1ozAR_7T5-Bj1tb-Hh8IXz0M56el_Abup1eFhA9rw9Vwpy8t-xeL3oQvbmX5fd3lSAeTzdDhAHE6Z6BN0N_oPZhHvDeW-Md8CY37f9gB4w6mIV8AN7nVsrjN0NXtqFn-X9FaSMih3SIPgtufPbjyeLtzgn4gZ2VsTjvfq52jp8QGSW7r9aySEp_ZRSURpbg5PHi58lbSjvx5kq0xMSEj8DH7dPOhyT-38DHw1P98WNzqGrg7a6YOzG3olUFdlXdHkTT1FIU1-7MW3me571u9zO2Zz41jaxEWauyquq5bQvT8ZKLqqxkVctSit0sBVeTng91sxf7mcO-xJsydpeMkPYvTIwrdnVbVbKwakIb8w_O-auQ5-AdoZuzAR_Th_QPP3j38KSsyctyKEKXrTWtlwj70ppI8W0PMmSxuxvrfgWky8E75jASzkn8PgT18sEZ-t37JfkG6rJYg-3eKWfouk477W-bmX_0dD5QBD7mM_0TAAD__8McY1E">