summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-06-20 01:05:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-06-20 01:05:19 +0000
commitbeb44788b36a3ab7db82d5ae4dd52d571d159bd6 (patch)
treecbee05726ddb1f96440905bc3eb1e44b501489cb /clang/lib/Sema
parent7070827be1fc6bbc02e932c1768bcf70aa823f04 (diff)
downloadbcm5719-llvm-beb44788b36a3ab7db82d5ae4dd52d571d159bd6.tar.gz
bcm5719-llvm-beb44788b36a3ab7db82d5ae4dd52d571d159bd6.zip
[modules] When determining whether a definition of a class is visible, check all modules even if we've already found a definition that's not visible.
llvm-svn: 240204
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaType.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index ff0e26c8402..d72f2595abe 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -5973,10 +5973,18 @@ bool Sema::hasVisibleDefinition(NamedDecl *D, NamedDecl **Suggested) {
}
assert(D && "missing definition for pattern of instantiated definition");
- // FIXME: If we merged any other decl into D, and that declaration is visible,
- // then we should consider a definition to be visible.
*Suggested = D;
- return LookupResult::isVisible(*this, D);
+ if (LookupResult::isVisible(*this, D))
+ return true;
+
+ // The external source may have additional definitions of this type that are
+ // visible, so complete the redeclaration chain now and ask again.
+ if (auto *Source = Context.getExternalSource()) {
+ Source->CompleteRedeclChain(D);
+ return LookupResult::isVisible(*this, D);
+ }
+
+ return false;
}
/// Locks in the inheritance model for the given class and all of its bases.
OpenPOWER on IntegriCloud