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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 06:23:08 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())
----------------
erichkeane wrote:

I don't think you could just do `cast_if_present`, I'm having troubles coming up with times where that wouldn't be a `VarDecl`, but I very much feel like it must be able to.

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


More information about the cfe-commits mailing list