summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-11-17 03:02:41 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-11-17 03:02:41 +0000
commit10568d8c1c81a513b50db5990b8cd770db60ed61 (patch)
treebf42376911892941bab8a7d9c8dd3cc132b1fd74 /clang/lib/Sema/SemaDeclCXX.cpp
parent4efa3952a9feb1ba7cbcf37745c282f90f77cb29 (diff)
downloadbcm5719-llvm-10568d8c1c81a513b50db5990b8cd770db60ed61.tar.gz
bcm5719-llvm-10568d8c1c81a513b50db5990b8cd770db60ed61.zip
[modules] Fix some more cases where we used to reject a conflict between two
declarations that are not simultaneously visible, and where at least one of them has internal/no linkage. llvm-svn: 253283
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index b7278904185..eb010e9e39a 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -8684,9 +8684,11 @@ Decl *Sema::ActOnNamespaceAliasDef(Scope *S, SourceLocation NamespaceLoc,
assert(!R.isAmbiguous() && !R.empty());
// Check if we have a previous declaration with the same name.
- NamedDecl *PrevDecl = LookupSingleName(S, Alias, AliasLoc, LookupOrdinaryName,
- ForRedeclaration);
- if (PrevDecl && !isDeclInScope(PrevDecl, CurContext, S))
+ LookupResult PrevR(*this, Alias, AliasLoc, LookupOrdinaryName,
+ ForRedeclaration);
+ LookupQualifiedName(PrevR, CurContext->getRedeclContext());
+ NamedDecl *PrevDecl = PrevR.getAsSingle<NamedDecl>();
+ if (PrevDecl && !isVisible(PrevDecl))
PrevDecl = nullptr;
NamedDecl *ND = R.getFoundDecl();
OpenPOWER on IntegriCloud