sammccall added a comment.

Thanks for fixing!

Early-claim is a blunt hammer and I'm always dreading side-effects.
This also feels a *lot* like implicit-this which is handled in another way.

So that seems worth a shot, but this approach is fine if that one doesn't work.



================
Comment at: clang-tools-extra/clangd/Selection.cpp:443
   // It would be nice if RAV handled this (!shouldTraverseImplicitCode()).
   if (auto *CTI = llvm::dyn_cast<CXXThisExpr>(S))
     if (CTI->isImplicit())
----------------
seems like it'd be more consistent to handle it here?

If it's a MemberExpr and the member is in an anonymous struct, then it's 
implicit if `isImplicit(ME.getBase())`.


================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:368
 
+TEST(LocateSymbol, AnonymousStructFields) {
+  auto Code = Annotations(R"cpp(
----------------
This example is quite complicated to the point where it's hard to see what it's 
testing... The example you have in the comment is much clearer.

If we also want to test named fields with inline struct types, maybe that 
should be a second test...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110825

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to