<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/86686>86686</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`std::variant<std::string>{}.index()` is not an integral constant expression
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hewillk
</td>
</tr>
</table>
<pre>
Clang rejects the following.
Not sure if it's just because a certain language feature isn't implemented yet, correct me if I'm missing something.
```cpp
#include <variant>
#include <string>
static_assert(std::variant<std::string>{}.index() == 0);
```
https://godbolt.org/z/8cTnafsMd
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyckstu3DoMhp-G3hAZyPT4tvAimTkDnEW76r6QbdpWKksDkc6lT194EiRA0FUBgYJI8NNP4rcibg7MHZQPUJ4zu-kSU7fws_P-V9bH8bU7eRtmTPzIgwrqwjhF7-OzC_MBwZzB3H-PirIlRjehU6Ba8HETxZ4HuwmjxYGTWhdwZ212ZpzY6q1DAlCt6Nar55WD8oivrEAnHGJKPCiuN-7_QPWKqxNxYUaJK-uyS3hT8B4r83aG6_U9Q4ULg99GRihOTzY5GxSK__5WFU0uzJ_FWxS16oafVoSTAjWiIxT3UNx_sE4fqU9A_QD1-eDCyC9ADVCLUJyhOKMBaqF4-CL37bmoXmUn0QXoMsexj14PMc1Al99Al2b4Eewk38Zs7IqxLVqbcZfXeX6sGsrbbOnYmMbUlaHejONg6rEsqe8bU-TTZKqpzVxHho6moCovS5O3h-nYc3m01Fct51xNcDS8WucP3j-t-9-ZE9m4a6qqqTJve_ZyMwtR4Ge8FYFo907q9p67fpsFjsY7UfmkqFPPHVTmH_cHlUEnGKKiDeiC8pysxyEGURsU-eWaWMTFkG3Jd19W6XTZ-sMQV6DLLun9urumuLsa6HIbRPYl74P-CQAA__8eD_Yq">