[clang] [clang-tools-extra] [clangd] show lambda name instead of operator() in signature help (PR #101857)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 08:33:23 PDT 2024


================
@@ -6292,11 +6298,16 @@ SemaCodeCompletion::ProduceCallSignatureHelp(Expr *Fn, ArrayRef<Expr *> Args,
         SmallVector<Expr *, 12> ArgExprs(1, NakedFn);
         ArgExprs.append(ArgsWithoutDependentTypes.begin(),
                         ArgsWithoutDependentTypes.end());
+        auto *const LambdaName =
+            DC->isLambda() ? cast<VarDecl>(NakedFn->getReferencedDeclOfCallee())
----------------
zyn0217 wrote:

So in this context, I presume `NakedFn` is a `DeclRefExpr` that refers to the `VarDecl` of the declaration? Can we assert it?
(It would be great if you can add tests from Erich above)

https://github.com/llvm/llvm-project/pull/101857


More information about the cfe-commits mailing list