[PATCH] D88297: [clangd] Trivial setter support when moving items to fields

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 06:42:22 PDT 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/Hover.cpp:414
 // If CMD is one of the forms:
 //   void foo(T arg) { FieldName = arg; }
 //   R foo(T arg) { FieldName = arg; return *this; }
----------------
can you also update the docs?


================
Comment at: clang-tools-extra/clangd/Hover.cpp:466
+    auto *ND = llvm::dyn_cast<NamedDecl>(CE->getCalleeDecl());
+    if (!ND)
+      return llvm::None;
----------------
nit: combine with the next condition, and perform the string comparison last, i.e.:

`if(!ND || !ND->isInStd || ND->getName() != "move")`


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