[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 10 20:06:23 PST 2023


================
@@ -150,6 +246,11 @@ std::vector<const NamedDecl *> HeuristicResolver::resolveMemberExpr(
   if (ME->isArrow()) {
     BaseType = getPointeeType(BaseType);
   }
+
+  if (BaseType->isDependentType())
----------------
zyn0217 wrote:

I don't know if I should assume the non-nullity for `BaseType`: All of the construction points appear to create expressions with valid base types. Except for ASTImporter and ASTReader, where an empty expression may be created. But would we somehow end up resolving expressions created from these two places? I suppose we might encounter these inside a preamble, but I don't think this is where the heuristic resolver would work.

Anyway, I moved this statement after the non-null check. Thanks for spotting it!

https://github.com/llvm/llvm-project/pull/71279


More information about the cfe-commits mailing list