nridge added inline comments.

================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:278
+            });
+        for (const NamedDecl *D : Decls) {
+          Outer.add(D, Flags);
----------------
sammccall wrote:
> sammccall wrote:
> > can we make this function return the decls, and make the callers call add() 
> > in a loop?
> > 
> > That way this function could be reused for the `operator->` lookup, and 
> > could be a standalone helper function outside this class. (Maybe eventually 
> > exposed in AST.h, as I can imagine it being useful in other places, but 
> > static in this file seems fine)
> with multiple lookup results we could add all, discard all, or pick one 
> arbitrarily.
> 
> I'm not sure what the best policy is, but it's worth pointing out in a 
> comment what the cases are and what the choice is.
> 
> I think this should only affects overloads, where returning all seems 
> reasonable (resolution would be way too much work).
> 
> Can you add a test?
Note, the additions to `LocateSymbol.Ambiguous` provide test coverage for this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71240



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

Reply via email to