]> granicus.if.org Git - clang/commitdiff
When pointing at a type decl reference, ASTLocation is a NamedDeclRef.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 29 Sep 2009 19:45:58 +0000 (19:45 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 29 Sep 2009 19:45:58 +0000 (19:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83099 91177308-0d34-0410-b5e6-96231b3b80d8

tools/CIndex/CIndex.cpp

index a2719f6fddd69328f03e958576e259852dac2c4f..cb870c9da4a65514035c3c62ecd4dac5f33bbab7 100644 (file)
@@ -513,6 +513,8 @@ CXCursor clang_getCursor(CXTranslationUnit CTUnit, const char *source_name,
   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) {