<div dir="ltr"><div>OK, thank you.<br><br></div>Filed <a href="https://llvm.org/bugs/show_bug.cgi?id=30201">https://llvm.org/bugs/show_bug.cgi?id=30201</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 30, 2016 at 9:34 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Aug 30, 2016 at 3:11 PM, Nemanja Ivanovic via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
> Rather than opening a bug, I thought I'd check if this is supposed to work<br>
> (given that the overloadable attribute is an extension).<br>
><br>
> Should this compile and have the expected semantics (i.e. call the int<br>
> version):<br>
><br>
> 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>
> }<br>
><br>
> It appears that the _Generic macro triggers overload resolution of some sort<br>
> which resolves the call to yet another overloaded function. So we hit an<br>
> UNREACHABLE in Sema::<wbr>FixOverloadedFunctionReference<wbr>.<br>
><br>
> If the argument in the call is replaced with a char value, there is no<br>
> crash.<br>
><br>
> In any case, presumably this crash behaviour should perhaps be improved with<br>
> a diagnostic.<br>
<br>
</div></div>The crash is definitely a bug, and we should either fix it with a<br>
diagnostic, or handle the overloadable attribute more sensibly. Can<br>
you file this as a bug (<a href="https://llvm.org/bugs" rel="noreferrer" target="_blank">https://llvm.org/bugs</a>)?<br>
<br>
Thanks!<br>
<br>
~Aaron<br>
<br>
><br>
> ______________________________<wbr>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
><br>
</blockquote></div><br></div>