<div dir="ltr"><div><div><div>Rather than opening a bug, I thought I'd check if this is supposed to work (given that the overloadable attribute is an extension).<br><br></div>Should this compile and have the expected semantics (i.e. call the int version):<br><br><span style="font-family:monospace,monospace">int __attribute__((overloadable)) test (int);<br>double __attribute__((overloadable)) test (double);<br>char testc(char);<br><br>#define testm(X) \<br>  _Generic ((X), \<br>            char : testc, \<br>            default: test) (X)<br><br><br>int foo() {<br>  return testm(4);<br>}</span><br><br></div>It appears that the <span style="font-family:monospace,monospace">_Generic</span> macro triggers overload resolution of some sort which resolves the call to yet another overloaded function. So we hit an UNREACHABLE in  <span style="font-family:monospace,monospace">Sema::FixOverloadedFunctionReference</span>.<br><br></div><div>If the argument in the call is replaced with a char value, there is no crash.<br></div><div><br></div>In any case, presumably this crash behaviour should perhaps be improved with a diagnostic.<br></div>