<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54379>54379</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
ICE in diagnostics when taking addresses of constrained functions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
royjacobson
</td>
</tr>
</table>
<pre>
An esoteric crash while diagnosing constraints of failed candidates for taking addresses:
```c++
template <int N>
struct A {
static void f() requires (N == 0) { return; }
static void f() requires (N == 1) { return; }
};
void (*f)() = A<2>::f;
```
Crashes with asserts (see https://godbolt.org/z/e4Pv3hP1G) because the diagnostic expects an argument and we don't pass one in `checkAddressOfFunctionIsAvailable`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUttu2zAM_Rr5hVhgS3YTP_jBTZqhL11_QZZoW60jZZKcrPv6Uc6lwwYMGEDbokkdHh6yc_qjaS1gcBG9UaC8DCOcRzMhaCMH64KxAyhnQ_TS2BjA9dBLimtQ0mqjZcQAvfMQ5XvKlVp7DAEDEy3Ldyy_vR_yiynGH5MtfyMejhNBABNbgocXJp4uESo4qwgtsPU1FyBEGYnlyRkNPeMbxmvw-H02VBHIfyGYHRnkKUIXKRpnb5l4JG_33zDFP2DSQVyZLUgLUEt49RUyIbTUF089kRiCgrcbdzV-l2ib1CcKZxNHkKShjwufgAhjjMdFUr4nG5zu3BRXzg_k_aQHy9eTGF-Lr6lyh0rOASGO9zGmhvHHERVBSgvSD_MBSXCaIZwpy1nG1xGOVBacRTAW0qxGVO_tZaLf-v1sVTTOPof2RCsguwkpZ3Uhn-lG6FrUMosmTtg8b58SyGd56mtE-9eapIW67xdtVX8tErLZT80fbZMwc7dS7kDONJ1uny9H796oNXJNCDPtHt9XpVjX2dj0qMo1Lx_qvsvXlVJFiXWuqg3XVV3wTmfUB06hYRVtJbd4hgWCzqzaZabhOee5KMr0FmJVrTdltSlEXwgh61qwMscDibFKPNI8Mt8slLp5CBScTIjhM0jymsEiLuUIX85xdL7x7uNNKtcFZ7OlfLPQ_wWY8R9S">