Hi Richard,

Please drop this patch.

I think the warning triggered correctly on the following snippet:

   int f(char *value);                 
   int f(const std::string &name) { return listAttr(name.c_str()); }   

I forgot that name.c_str() returns a const char*, which is implicitly converted.

vedant

On Jul 29, 2015, at 5:09 PM, Richard Trieu <[email protected]> wrote:

> 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 <[email protected]> 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
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to