<div dir="ltr">This is now PR15291. Thanks.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 February 2013 03:23, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.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 Feb 16, 2013, at 5:18 AM, Alexander Zinenko <<a href="mailto:ftynse@gmail.com">ftynse@gmail.com</a>> wrote:<br>


> +Richard Smith<br>
><br>
> Investigating another issue, I found out that an instantiated noreturn template function can't be implicitly used as not-noreturn argument while non-template function can.<br>
> Here is an example:<br>
><br>
> void __attribute__((noreturn)) func(int i) {}<br>
><br>
> template <typename T><br>
> void __attribute__((noreturn)) tfunc(T t) {}<br>
><br>
> typedef void (*ptr)(int);<br>
><br>
> void foo(ptr p) {}<br>
><br>
> void bar() {<br>
>   foo(func); // Okay<br>
>   foo(tfunc<int>); // Error: ... candidate function 'foo' not viable<br>
> }<br>
><br>
> It is most likely due to noreturn function representation (there was a discussion on PR15105 lately). As far as I see, SemaOverload.cpp contains a special case for noreturn adjustment as an implicit conversion, but it doesn't account for templates.<br>


><br>
> One would expect consistent behavior in this case, though.<br>
> Should I file a bug for it?<br>
<br>
</div></div>Yes.  The problem is almost certainly that template argument deduction should permit an inexact match requiring a noreturn conversion in the same sorts of places that it would permit an inexact match requiring a qualification conversion.<br>


<span class="HOEnZb"><font color="#888888"><br>
John.<br>
</font></span></blockquote></div><br></div>