hazohelet marked 2 inline comments as done.
hazohelet added a comment.

Consider the following code. (I added another parameter to the original code so 
that the covered range becomes clearer)

  void func(int aa, int bb);
  
  
  void test() { func(1, "two"); }

BEFORE this patch:

  source:4:15: error: no matching function for call to 'func'
      4 | void test() { func(1, "two"); }
        |               ^~~~
  source:1:6: note: candidate function not viable: no known conversion from 
'const char[4]' to 'int' for 2nd argument
      1 | void func(int aa, int bb);
        |      ^
      2 |
      3 |
      4 | void test() { func(1, "two"); }
        |                       ~~~~~

AFTER this patch:

  source:4:15: error: no matching function for call to 'func'
      4 | void test() { func(1, "two"); }
        |               ^~~~
  source:1:6: note: candidate function not viable: no known conversion from 
'const char[4]' to 'int' for 2nd argument
      1 | void func(int aa, int bb);
        |      ^            ~~~~~~



================
Comment at: clang/lib/Sema/SemaOverload.cpp:10752
   QualType ToTy = Conv.Bad.getToType();
+  ParmVarDecl *ToPVD = !isObjectArgument ? Fn->getParamDecl(I) : nullptr;
 
----------------
tbaeder wrote:
> tbaeder wrote:
> > Can this be `const`?
> Actually, `ToPVD` is only used to access its source range later, isn't it? If 
> so, can we just declare the a `ToPVDRange` or something here and use that 
> later for diagnostics?
Right. I fixed it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153359/new/

https://reviews.llvm.org/D153359

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to