upsj added a comment.

Your approach to handling implicit conversions is much nicer than mine, so I 
abandoned my revision. There is still one case (that might even occur in the 
code base I'm working on?) that this change would lead to incorrect hints on. 
WDYT about keeping the other changes, but using my pack detection logic?



================
Comment at: clang-tools-extra/clangd/AST.cpp:790
+    // Skip functions with less parameters, they can't be the target.
+    if (Callee->parameters().size() < Parameters.size())
+      return;
----------------
This is not a sufficient check, since the other parameters need not be from an 
expanded pack.
Example:
```
void foo(int a, int b);
int baz(int x, int y);
template <typename... Args>
void bar(Args... args) {
  foo(baz(args, 1)...);
}

void foo() {
  bar(1, 42);
}
```
Here we shouldn't print a hint at all, but we print `x:` and `y:`
The important distinction is between `Expr(args...)` and `Expr(args)...`, which 
can be decided in the instantiated case by the check I implemented in 
https://reviews.llvm.org/D130259 for all cases, except when `args` only 
consists of a single element.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130260

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

Reply via email to