[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 30 06:28:45 PDT 2021


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/Selection.cpp:745
+      if (auto *FD = llvm::dyn_cast<FieldDecl>(ME->getMemberDecl())) {
+        if (FD->getParent()->isAnonymousStructOrUnion())
+          return SourceRange(ME->getMemberLoc(), ME->getEndLoc());
----------------
in theory this check should be redundant, as each field should own its tokens. but given the complexity of C++ just wanted to be conservative.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110825



More information about the cfe-commits mailing list