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

llvm-svn: 83099
This commit is contained in:
Argyrios Kyrtzidis 2009-09-29 19:45:58 +00:00
parent 05677cae08
commit 419e38bbe2
1 changed files with 2 additions and 0 deletions

View 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) {