[PATCH] Sema: Fix spurious 'infinite recursion' warning for overloaded functions

Richard Trieu rtrieu at google.com
Wed Jul 29 17:09:38 PDT 2015


Vedant,

I have tried the example in your test case and could not get a spurious
warning from it.  Further, having two different functions map to the same
canonical function decl would be problematic for Clang.  Can you give any
more information about where you saw this spurious warning?

Richard

On Wed, Jul 29, 2015 at 4:41 PM, Vedant Kumar <vsk at apple.com> wrote:

> Sema::checkRecursiveFunction() currently cannot tell overloaded functions
> apart.
>
> This results in spurious warnings -- clang claims that a function is
> infinitely recursive when it in fact just calls a different function. The
> attached patch fixes the problem by keeping the original FunctionDecl
> around, instead of switching to the 'canonical' decl.
>
> I don't have commit rights, so I'd appreciate someone taking a look at the
> patch and guiding it into trunk :).
>
> vedant
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150729/c81fd567/attachment.html>


More information about the cfe-commits mailing list