From 0582c897ec7261b4c6af0fe26dc2a0b6b54d266c Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 2 Nov 2010 23:17:51 +0000 Subject: [PATCH] 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 --- tools/libclang/CIndex.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.40.0