diff --git a/clang-tools-extra/clangd/FindTarget.cpp b/clang-tools-extra/clangd/FindTarget.cpp index bc4002c42623b0..c6022b2463e859 100644 --- a/clang-tools-extra/clangd/FindTarget.cpp +++ b/clang-tools-extra/clangd/FindTarget.cpp @@ -175,6 +175,8 @@ std::vector resolveDependentExprToDecls(const Expr *E) { if (ME->isArrow()) { BaseType = getPointeeType(BaseType); } + if (!BaseType) + return {}; if (const auto *BT = BaseType->getAs()) { // If BaseType is the type of a dependent expression, it's just // represented as BultinType::Dependent which gives us no information. We