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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy modernize-loop-convert produces invalid code
        </td>
    </tr>

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

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

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

<pre>
    https://godbolt.org/z/oo4cv3d97

Given:

```c++
#include <stdio.h>
#include <string.h>

int combo_stack[176*7][10];

void func()
{
        for ( int q = 0; q < 1232; q++ )
                memset(combo_stack[q], 0, sizeof(combo_stack[q]));
}
```

`modernize-loop-convert` produces:

```c++
#include <stdio.h>
#include <string.h>

int combo_stack[176*7][10];

void func()
{
        for (auto & q : combo_stack)
                memset(q, 0, sizeofq);
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdU1ly4yAQPQ36oaxCoPVDH17GOcYUAiyRILABKZWcflryjOO4khxgqpqlaXj9eA2dk2_tEOM5ILZF9AjWO9k5E1Pne_DeoTmXi5nJpkLkgMj22j_pWdnl0N0aKsnVBKK7xa6rlGkrzCQVRmwfotQuHRD79XXUa9vfh9de24iFGzv3O0QuXlCxy6oS0W2FisPikGVku_sjs9MSnyYLVGpEm7-h6ranOTmPIYYX7AvkPmACEOt0jzPK6OpdL4I_EAhMmlGNQUU4_ZnUZaFB9wAEXdDvyp2-2dMsdiNcHR70exB1dFJ5C3gb49x5I5ydlY8QwGfv5CRU-A8KwafoYCzXCmw_ZflG_MuD1pefRU1kC4-YNTyJOhrVCsNtv4lavuGvBb6pC29k5gauIWBfMnnz-GV0HKYuBcrgGDP_GzYA8KwEcD3qECYoEz0WJaFZMrRVRbJM5nWTN6WkjAulKtVldSHqE-kkTQzvlAktqIooteoVrxAwB4kT3VJCKSmznLC8JiytK0ZUkZNMKl7RukA5USPXJl14LH858e1KqZv6AEGjQwwfQR6C7q1SazrAh2IMzrcghHX-GZTyL8mav135_wFeqTI1">