summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-05 01:11:47 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-05 01:11:47 +0000
commit5c193c7ed6eb50a6f96000f306727d988cde43d2 (patch)
treefe18fae502378d81cc0acbf48c8210d990cc2198 /clang/lib/Sema/SemaLookup.cpp
parent31a8d051ddc88fb654ad676ffa0a90bb6decb0c8 (diff)
downloadbcm5719-llvm-5c193c7ed6eb50a6f96000f306727d988cde43d2.tar.gz
bcm5719-llvm-5c193c7ed6eb50a6f96000f306727d988cde43d2.zip
When we're performing name lookup for a tag, we still allow ourselves
to see hidden declarations because every tag lookup is effectively a redeclaration lookup. For example, image that struct foo; is declared in a submodule that is known but hasn't been imported. If someone later writes struct foo *foo_p; then "struct foo" is either a reference or a redeclaration. To keep the redeclaration chains sound, we treat it like a redeclaration for name-lookup purposes. llvm-svn: 147588
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index ae950ff27aa..7ee50e3a4c1 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -1171,7 +1171,7 @@ bool Sema::LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation) {
// If this declaration is module-private and it came from an AST
// file, we can't see it.
- NamedDecl *D = R.isForRedeclaration()? *I : getVisibleDecl(*I);
+ NamedDecl *D = R.isHiddenDeclarationVisible()? *I : getVisibleDecl(*I);
if (!D)
continue;
@@ -1194,7 +1194,7 @@ bool Sema::LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation) {
if (!LastDC->isFileContext() && !S->isDeclScope(*LastI))
break;
- D = R.isForRedeclaration()? *LastI : getVisibleDecl(*LastI);
+ D = R.isHiddenDeclarationVisible()? *LastI : getVisibleDecl(*LastI);
if (D)
R.addDecl(D);
}
OpenPOWER on IntegriCloud