summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/AST/DeclBase.cpp2
-rw-r--r--clang/test/Modules/Inputs/namespaces-left.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 6c9d5ca76c8..2ca491194dd 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/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/clang/test/Modules/Inputs/namespaces-left.h b/clang/test/Modules/Inputs/namespaces-left.h
index bd192afd2e8..fa93af27465 100644
--- a/clang/test/Modules/Inputs/namespaces-left.h
+++ b/clang/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);
OpenPOWER on IntegriCloud