<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83101>83101</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang accepts invalid program invovling function parameter as non-type template argument
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ranaanoop
</td>
</tr>
</table>
<pre>
The following program is accepted by clang but rejected by both gcc and clang. [Demo](https://godbolt.org/z/M61hq7zv4):
```
#include <array>
auto function(auto s) -> std::array<int, s + s> {
return {};
}
int main() {
auto const a = function(std::integral_constant<int, 3>{});
return a.size();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0kkGPqzgMxz-NuVitgkMLHDhM2-G2t72vDKSQVUjYJHTV-fRPoZ1p9aQnISCW7f_fzo9D0KNVqoHDCQ6XjNc4Od94tszWuSXr3HBv_p4UXp0x7n9tR1y8Gz3PqANy36slqgG7O_aG7YjdGtGrf1X_jHYuTjj2PbIdHil7hMPpomYHhwtQNcW4BJAfQC1QO7qhcybunR-B2i-g9q9jPv1Xft0KoDqliQuI7_dRPJ_HkaS2vVkHhSDP7D3fQX6-F_AaHV5X20ftLFC1nQNQjTuQnxjikBTkx7P2rG0EOmNAoBOGlALl6dEKvYqrt1ugvIB8htP_m6C2EWfWSSupvKoRcRPvnQ0RGUFe3o39ONE2qtGz-WdLZBtfrmQa7qGeNvPW-WmN90F_qYf0nwz-rDAbGjnUsuZMNXkpaiFKUebZ1BxkeeioqliUx7yrqLheaeg6Kjt1JFZ1phsSVAiiUhR5nuf7QtBxGIq6kte8YqqgEGpmbfbG3OZ0s5kOYVVNJXORZ4Y7ZcLGH9EGCBAlFH2T8nfdOgYohNEhhleHqKNRzXlD7gFhQG1vbPTw4tPe3M0kYr83iwt7nlVUHjmgdXYX74vCqObFcFTIflxnZWO2etP8BqaO09rtezcDtcnG87NbvEu0A7XbVAGo3Qb7FQAA__9xWAPt">