When pointing at a type decl reference, ASTLocation is a NamedDeclRef.

llvm-svn: 83099
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index a2719f6..cb870c9 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/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) {