[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

Tobias Ribizel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 4 05:24:50 PDT 2022


upsj added inline comments.


================
Comment at: clang-tools-extra/clangd/AST.cpp:772
+      size_t PackLocation = OptPackLocation.getValue();
+      ArrayRef<ParmVarDecl *> MatchingParams =
+          Callee->parameters().slice(PackLocation, Parameters.size());
----------------
Similar to processCall in InlayHints.cpp, this may have issues with varargs functions. Maybe on top of checking for unexpanded pack expression arguments, I should add a check `Callee->getNumParams() == Args.size()`. A corresponding test fails by not forwarding a fixed parameter right now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124690



More information about the cfe-commits mailing list