From: Ted Kremenek Date: Tue, 2 Nov 2010 23:17:51 +0000 (+0000) Subject: Don't add Decls with an invalid location to DeclsInContainer. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0582c897ec7261b4c6af0fe26dc2a0b6b54d266c;p=clang Don't add Decls with an invalid location to DeclsInContainer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118111 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index f4cae89f8f..d825a400f9 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -868,7 +868,8 @@ bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) { for (DeclContext::decl_iterator I = D->decls_begin(), E = D->decls_end(); I!=E; ++I) { Decl *subDecl = *I; - if (!subDecl || subDecl->getLexicalDeclContext() != D) + if (!subDecl || subDecl->getLexicalDeclContext() != D || + subDecl->getLocStart().isInvalid()) continue; DeclsInContainer.push_back(subDecl); }