[PATCH] D130260: [clangd] Make forwarding parameter detection logic resilient
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 22 04:18:04 PDT 2022
ilya-biryukov added inline comments.
================
Comment at: clang-tools-extra/clangd/AST.cpp:828
// find the argument directly referring to the first parameter
- for (auto It = Args.begin(); It != Args.end(); ++It) {
- const Expr *Arg = *It;
- if (const auto *RefArg = unwrapForward(Arg)) {
+ auto LastPosibleArg = Args.end();
+ for (size_t I = 1; I < Parameters.size(); ++I) {
----------------
NIT: you could use `Args.end() - Parameters.size()` or `std::advance` equivalent.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130260/new/
https://reviews.llvm.org/D130260
More information about the cfe-commits
mailing list