[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

Tor Shepherd via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 19 06:56:24 PDT 2024


================
@@ -372,6 +382,34 @@ maybeDropCxxExplicitObjectParameters(ArrayRef<const ParmVarDecl *> Params) {
   return Params;
 }
 
+llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) {
+  if (Capture.capturesVariable())
+    return Capture.getCapturedVar()->getName();
+  if (Capture.capturesThis())
+    return llvm::StringRef{"this"};
+  return llvm::StringRef{"unknown"};
----------------
torshepherd wrote:

Changed this to a switch case

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


More information about the cfe-commits mailing list