<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/133963>133963</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Rejects-valid with static_assert referring to templated array variable with incomplete bound
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
efriedma-quic
</td>
</tr>
</table>
<pre>
```
template<int x> int a[] = {1,2,3};
static_assert(a<1> + 1 - a<1> == 1);
```
```
<source>:2:15: error: static assertion expression is not an integral constant expression
2 | static_assert(a<1> + 1 - a<1> == 1);
| ^~~~~~~~~~~~~~~~~~~~
<source>:2:20: note: indexing of array without known bound is not allowed in a constant expression
2 | static_assert(a<1> + 1 - a<1> == 1);
| ^
1 error generated.
```
This seems wrong; I think referring to the array like this should force the computation of the correct type.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0k8-OmzAQxp9muIwSGRsIOXAgyUbqteq9MmYC7ho7tU2ye-mzVw7Z7r_eqlpIDNZ8Hv--YWQIerBEDZQ7KA-ZnOPofEMnr6mf5OrnrFXWuf65gYrdH9ZGms5GRgKx1zbiE4gHTIFcTkEQB4TNLge-58D3AjYHEDtgbYgyavVdhkA-Aq8liH2e1MB3mOMKXzfEIZ2SA98u0rf1P36KfXCzVwTiAUTLQbR5CaJF8t75FCx1camrnUV6OnsKIYU6oHURpU0INHhpUDkborTxTRqwFhGRI2z2-A8YN_37BeXDr8_r71ycJRzrkvctatvTk7YDuhNK7-UzXnUc3Rzx0bqrxc7Ntv8DaIy7Uo_aovyvhAvUJ8wXVmBtvnQGB7LkZaR-_bnB30YdMBBNAa_e2QHEDr9gHLV9RE8n8j6BR4dxpDu80Y-UMgKG0c2mx5Pzim4Jyk3nOTE5m8xatrwnFTE-n2md9Y3ot2IrM2ryTSFKIURVZWPTn0RRbU51J0RR5zljbLvJq5qrbVlWVV1nuuGMl6xgeV4XW16t1aniZamU6mrGOCugYDRJbdbGXKa180OmQ5ipyYXYViIzsiMTXubPNylr1c1DgIIZHWJ41UUdDTVf6QepGFYXaXR_a_j7bn1w5z6q_d2ji_RadoYWobbJGEORln8lm71pxhjPAUQL_Aj8OOg4zt1auQn4MV3l_lqdvUsXAX688QTgxzvSpeG_AwAA__8iClKc">