From 4a7d04b9c93f668a057431c079ce60ee80329f9f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 4 Mar 2014 00:21:14 +0000 Subject: [PATCH] Fix typo that resulted in names at TU scope getting lost sometimes after a module import. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202771 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/DeclBase.cpp | 2 +- test/Modules/Inputs/namespaces-left.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 6c9d5ca76c..2ca491194d 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -1293,7 +1293,7 @@ DeclContext::lookup(DeclarationName Name) { return R.first->second.getLookupResult(); ExternalASTSource *Source = getParentASTContext().getExternalSource(); - if (Source->FindExternalVisibleDeclsByName(this, Name) || R.second) { + if (Source->FindExternalVisibleDeclsByName(this, Name) || !R.second) { if (StoredDeclsMap *Map = LookupPtr.getPointer()) { StoredDeclsMap::iterator I = Map->find(Name); if (I != Map->end()) diff --git a/test/Modules/Inputs/namespaces-left.h b/test/Modules/Inputs/namespaces-left.h index bd192afd2e..fa93af2746 100644 --- a/test/Modules/Inputs/namespaces-left.h +++ b/test/Modules/Inputs/namespaces-left.h @@ -1,5 +1,13 @@ +namespace RedeclAcrossImport { + enum E { e }; +} + @import namespaces_top; +namespace RedeclAcrossImport { + E x = e; +} + float &global(float); float &global2(float); -- 2.40.0