[PATCH] D84837: [clangd] Fix an assertion failure in TargetFinder's heuristic resolution of dependent type.

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 29 10:01:02 PDT 2020


nridge accepted this revision.
nridge added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:171
 // or more declarations that it likely references.
-std::vector<const NamedDecl *> resolveDependentExprToDecls(const Expr *E) {
-  assert(E->isTypeDependent());
+std::vector<const NamedDecl *> resolveExprToDecls(const Expr *E) {
   if (const auto *ME = dyn_cast<CXXDependentScopeMemberExpr>(E)) {
----------------
I do think the "heuristic" nature of this function is an important part of its interface that's currently lost with this rename.

However, I think that's fine for now. In a future refactor (to get code-completion to use this machinery as well) I plan to move these functions into a `HeuristicResolver` class or a `heuristics` sub-namespace or something like that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84837



More information about the cfe-commits mailing list