[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
Sun May 8 06:24:09 PDT 2022
upsj added inline comments.
================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:208
+ // If the parameter is part of an expanded pack and not yet resolved
+ if (/*isExpandedParameter(Param) && */
+ ForwardedParams.find(Param) == ForwardedParams.end()) {
----------------
This needs to be fixed, see `ParameterHints.VariadicPlain` vs. `ParameterHints.VariadicForwarded` if uncommented - I'd need some input from somebody with more knowledge about the AST
================
Comment at: clang-tools-extra/clangd/InlayHints.cpp:314
+ if (auto *FuncCandidate = dyn_cast_or_null<FunctionDecl>(Candidate)) {
+ if (FuncCandidate->getNumParams() == D->getNumArgs()) {
+ if (MatchingDecl) {
----------------
There is probably more generic functionality available for this?
================
Comment at: clang-tools-extra/clangd/unittests/InlayHintTests.cpp:447
+ namespace std { template <typename T> T&& forward(T&); }
+ void *operator new(unsigned long, void *);
+ struct S {
----------------
This is not portable, but I don't have access to size_t
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