[cfe-dev] Template matching question

David Blaikie dblaikie at gmail.com
Thu Feb 20 10:18:13 PST 2014


Could you provide a standalone example of the problem? And include a log
showing the file contents, the compiler version, the full command used to
compile the source as well as all the output (error messages, etc)?

My attempts to reproduce this with ToT Clang seem to have failed -
something similar to what you described compiles without error.


On Thu, Feb 20, 2014 at 8:19 AM, Michael Steinberg <
michael.steinberg at tu-clausthal.de> wrote:

> Hello,
> there is an interesting (for me) problem with luabind that you might be
> able to answer.
>
> Considering the template:
>
> template< typename T >
> void deduce( T (*)(), ... ) {}
>
> template< typename T >
> void deduce( T f, SomeType g ) {}
>
> ...more overloads...
>
> and the function:
>
> void foo() {
>    throw some();
> }
>
> deduce( foo );
>
> clang 3.2 seems to add an implicit attribute "noreturn" (I assume that
> is because clang detected the function will never return). This
> attribute seems to rule out the given first overload of function
> template "deduce", which would otherwise be responsible to match the
> given function's signature and consequently fails on the second
> overload. Is that legal? Or maybe the mismatch is caused by another reason?
>
> Kind regards,
> Michael
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140220/86b923b5/attachment.html>


More information about the cfe-dev mailing list