Index: clang-tools-extra/trunk/clangd/XRefs.cpp =================================================================== --- clang-tools-extra/trunk/clangd/XRefs.cpp +++ clang-tools-extra/trunk/clangd/XRefs.cpp @@ -1230,6 +1230,8 @@ RecursionProtectionSet RPSet; Optional Result = getTypeAncestors(*CXXRD, AST.getASTContext(), RPSet); + if (!Result) + return Result; if ((Direction == TypeHierarchyDirection::Children || Direction == TypeHierarchyDirection::Both) &&