<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/80285>80285</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[coverage] crash with CXXUnresolvedConstructExpr in `if constexpr`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hanickadot
</td>
</tr>
</table>
<pre>
Clang `main` and `18` crashes with this code: (`-fprofile-instr-generate -fcoverage-mapping -std=c++17`)
```c++
struct false_value {
constexpr operator bool() {
return false;
}
};
void foo()
{
if constexpr (false_value{}) { };
}
```
https://godbolt.org/z/833ej19rP
It's a bug in my recent change https://github.com/llvm/llvm-project/pull/78033 ... writing patch now, this is so it's visible.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8GO2yAQ_ZrxBcXCY8eODz5skkbqrZdKe6swjG22BCzASbdfXxEn3WxvlSJiYObNG-Y9EYIeLVEH2z1sj5lY4uR8Nwmr5U-hXMx6p967gxF2ZFDzs9AWas6EVWlb7NJGehEmCuyq48TipAOTThGULwwwBWyG2btBG9poG6LfjGTJi0hsM0h3IS9G2pzFPGs7sk2ICsqjBNwD7osGag7YAj8Cf7mvNV9_95j1NES_yMgGYQL9uAizEINm_8hrpbMh0q_ZMzen2s6z3jmT-GH7KRJ46yku3q5YUD5dNcf7d3N8Ok_rxWnFBudWwEfUR6oe2AcFwN0TzxTWHO802Cfov_UeLT-XnGKcA5QvgCfA0-hU70zMnR8BT78BT7uypLei9d-ek75GwCYwwfplZNqy8zvzJMlGJidhR2L_oOo4LX0u3RnwZMzl8beZvXsjGQFP82IM4KnZ8bJkeZ6zq9cxTXIWUU7MuivgYVWFDiw4plcKFx10byhfeWWqK1VbtiKjrmh43bRFVdTZ1ClsVFs1Sg6qUJIEr2TNlWiLbYtiIMp0hxwrjrwosCqxzmWryr4h0VSoRNvsoOJ0FtrkiXh6n0yHsFC347jbZkb0ZMJN_oiWrux2CYjJDb67NdsvY4CKGx1i-ECJOpqbbx4ahu1xtcJqhMPr63frKThzIXVIw08K_ZIEoG0yz7MmoObZ4k33389_oxvSuFM7fwIAAP__mromkg">