[PATCH] D88297: [clangd] Trivial setter support when moving items to fields
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 25 06:41:19 PDT 2020
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
Nice, thanks!
================
Comment at: clang-tools-extra/clangd/Hover.cpp:461
+ if (auto *CE = llvm::dyn_cast<CallExpr>(RHS->IgnoreCasts())) {
+ // Make sure we get the version of move with 1 arg, the other is for moving
+ // ranges.
----------------
nit: you could skip this check if you like, the other variant isn't going to be on the RHS of an assignment :-)
================
Comment at: clang-tools-extra/clangd/Hover.cpp:468
+ return llvm::None;
+ if (ND->getName() != "move" || !ND->isInStdNamespace())
+ return llvm::None;
----------------
I guess you want `!ND->getIdentifier() || ND->getName() != "move" || ...` to guard against it being a special name somehow - getName() asserts in that case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88297/new/
https://reviews.llvm.org/D88297
More information about the cfe-commits
mailing list