aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-09-29 19:45:58 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-09-29 19:45:58 +0000
commit05a7651c7a03c393eed563201fb5848b569f8ed8 (patch)
tree1a020ef63832ab4f64e2e50556e54ef2f830b3b8
parentef6cd6712cb5d6129c8d18893cca41396a479fb2 (diff)
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
-rw-r--r--tools/CIndex/CIndex.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index a2719f6fdd..cb870c9da4 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -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) {