[cfe-commits] PATCH: Add support for resolving overloaded template functions in Sema::DiagnoseEmptyLookup

Kaelyn Uhrain rikka at google.com
Thu Aug 4 15:04:48 PDT 2011


Doug,

Here's a the patch building on my previous overloaded function resolution
patch. In addition to handling template functions properly when doing the
overload resolution (which turned out to be easier than anticipated), it
also fixes tiny bug in my previous patch that lead to no error message being
printed out if the call to BestViableFunction did not succeed. I have a
couple of questions about the remaining cases you mentioned in the thread
for my previous patch:

  1. For the case of member functions, were referring to when the typo
correction is being done on a member function called from within another
member function ("class X { void foo(); void b() { fio(); };", correcting
fio to foo) or when one is called through "." or "->" ("void b() { X x;
x.fio(); }" and correcting x.fio to x.foo)? The former case seems to work
already, and the latter is not handled by DiagnoseEmptyLookup but by
LookupMemberExprInRecord in SemaExprMember.cpp.

  2. What exactly was the situation you were referring to when you said "we
could see using declarations (which we'd need to look through) or unresolved
using declarations (which we'd probably just give up on)"? That given e.g.

   namespace NS { void foo(double); }
   void foo(int);
   using namespace NS;
   void bar() { Foo(0.5); }

both foo(int) and foo(double) from NS should be candidates for overload
resolution when correcting Foo(0.5), and when "foo" is suggested as a
correction the note points foo(double)?

Thanks,
Kaelyn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110804/6a45a7f5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typo-correction-template-overload.diff
Type: text/x-diff
Size: 4633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110804/6a45a7f5/attachment.diff>


More information about the cfe-commits mailing list