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

    <tr>
        <th>Summary</th>
        <td>
            C++ compile-time array bounds unsuccessfully inferred from template expansions
        </td>
    </tr>

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

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

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

<pre>
    https://compiler-explorer.com/z/33Yhbxdoc
```cpp
template <int... VALUES>
struct C {
    static constexpr int VALUEARRAY[] = {VALUES...};
};

static_assert(C<0,1,2,3,4>::VALUEARRAY[4] == 4);
```
clang needs the hint of `sizeof...(VALUES)` to build correctly
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcUs2OozgQfpriUgoyZYfAgQMhndOeerUr9WkEphI8MhjZppX0048Y6Gn1SEjYpfr-rK8Nwdwn5gqOZzheknaJg_PVaHtSSiad65_VEOMcQNZAV6CrduNsLPsDP2brPPtUuxHo-gF0lfJt6B690yAuIGrIxfbped4mkcfZtpERZGOmmKYp_l__89_LvyBfto0Q_aIjNgin8zZBRAyxjUajdlOI_Jg9miluyPr1tX7bzCPIywrbGNM0hdMF5M7y7bwrrZw_2hDYR6CiAdkIoCYDagiokUCNWn3JGmT9TUztaqugAiq_mD8Tb1dt2-mOE3MfMA6Mw2rb3RByEcwHu9tqkor9CaiEXGB02C3G9qid96yjfSZ9JftSlm3CVXaSIpNKFCoZqjIT5elY5uWp6E95ISnvilz0rMRRdYLKxFQkSGWCiixXhaCUT50q8vymqNRKSwFK8Ngam1r7PqbO3xMTwsJVlslS5oltO7bhsxu-WrcO3XIPoIQ1IYYvXDTRctUAnYHOuJfkEM3I2HrfPrFzy9QHXKawaM0h3BZrn2imG3vPPd68G_FPPfgxt1MwbgrJ4u1fDbybOCzdXrvVwP47zN79ZB2Brr9TBKDrHuS9ol8BAAD__8nd3Zg">