summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/IdentifierResolver.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-06 23:51:29 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-06 23:51:29 +0000
commit6ad0ef50918ed9cefff5fefb37d4f6dc2fac2343 (patch)
tree56e7cd61b0d1d20a40f4edb5097519c9e3af9537 /clang/lib/Sema/IdentifierResolver.cpp
parent44a3da6c4dc98e9303c07836257ced0bc4a12cbb (diff)
downloadbcm5719-llvm-6ad0ef50918ed9cefff5fefb37d4f6dc2fac2343.tar.gz
bcm5719-llvm-6ad0ef50918ed9cefff5fefb37d4f6dc2fac2343.zip
Allow Objective-C entities to be declared within a transparent context
nested in the translation unit. This fixes <rdar://problem/6476070>. llvm-svn: 61832
Diffstat (limited to 'clang/lib/Sema/IdentifierResolver.cpp')
-rw-r--r--clang/lib/Sema/IdentifierResolver.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Sema/IdentifierResolver.cpp b/clang/lib/Sema/IdentifierResolver.cpp
index 18e78a0d170..08c9bdeb319 100644
--- a/clang/lib/Sema/IdentifierResolver.cpp
+++ b/clang/lib/Sema/IdentifierResolver.cpp
@@ -60,8 +60,7 @@ DeclContext *IdentifierResolver::LookupContext::getContext(Decl *D) {
else
return TUCtx();
- while (Ctx->isTransparentContext())
- Ctx = Ctx->getParent();
+ Ctx = Ctx->getLookupContext();
if (isa<TranslationUnitDecl>(Ctx))
return TUCtx();
@@ -132,8 +131,7 @@ IdentifierResolver::~IdentifierResolver() {
/// true if 'D' belongs to the given declaration context.
bool IdentifierResolver::isDeclInScope(Decl *D, DeclContext *Ctx,
ASTContext &Context, Scope *S) const {
- while (Ctx->isTransparentContext())
- Ctx = Ctx->getParent();
+ Ctx = Ctx->getLookupContext();
if (Ctx->isFunctionOrMethod()) {
// Ignore the scopes associated within transparent declaration contexts.
OpenPOWER on IntegriCloud