diff options
Diffstat (limited to 'lib/Index/Entity.cpp')
-rw-r--r-- | lib/Index/Entity.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Index/Entity.cpp b/lib/Index/Entity.cpp index 8178fbe7ab..b6fb17fc2b 100644 --- a/lib/Index/Entity.cpp +++ b/lib/Index/Entity.cpp @@ -111,6 +111,10 @@ Entity EntityGetter::VisitNamedDecl(NamedDecl *D) { } Entity EntityGetter::VisitVarDecl(VarDecl *D) { + // Local variables have no linkage, make invalid Entities. + if (D->hasLocalStorage()) + return Entity(); + // If it's static it cannot be referred to by another translation unit. if (D->getStorageClass() == VarDecl::Static) return Entity(D); |