When pointing at a type decl reference, ASTLocation is a NamedDeclRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83099 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index a2719f6..cb870c9 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -513,6 +513,8 @@
ASTLocation ALoc = ResolveLocationInAST(CXXUnit->getASTContext(), SLoc);
Decl *Dcl = ALoc.getParentDecl();
+ if (ALoc.isNamedRef())
+ Dcl = ALoc.AsNamedRef().ND;
Stmt *Stm = ALoc.dyn_AsStmt();
if (Dcl) {
if (Stm) {