summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.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/SemaLookup.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/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 7236e99942b..9b5d511818e 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -1547,6 +1547,14 @@ bool Sema::isVisibleSlow(const NamedDecl *D) {
return LookupResult::isVisible(*this, const_cast<NamedDecl*>(D));
}
+bool Sema::shouldLinkPossiblyHiddenDecl(LookupResult &R, const NamedDecl *New) {
+ for (auto *D : R) {
+ if (isVisible(D))
+ return true;
+ }
+ return New->isExternallyVisible();
+}
+
/// \brief Retrieve the visible declaration corresponding to D, if any.
///
/// This routine determines whether the declaration D is visible in the current
OpenPOWER on IntegriCloud