aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-27 04:21:56 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-27 04:21:56 +0000
commit551f48c2d96c8a519feb195d34a691c8b97b3994 (patch)
tree3595d350c97dd33c6496749fa6d8937e44e4c1de /lib/Sema/SemaLookup.cpp
parent9af5500f3f132f9a2f9abbe82113a7c7bb751472 (diff)
Tests and fixes for templates declared within (non-template)
classes. Test case from Anders Carlsson, fix from Piotr Rak! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 616ee3dd93..770f9301e6 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -600,10 +600,11 @@ Sema::CppLookupName(Scope *S, DeclarationName Name,
// base classes, we never need to perform qualified lookup
// because all of the members are on top of the identifier
// chain.
- if (isa<RecordDecl>(Ctx) &&
- (R = LookupQualifiedName(Ctx, Name, NameKind, RedeclarationOnly)))
- return std::make_pair(true, R);
-
+ if (isa<RecordDecl>(Ctx)) {
+ R = LookupQualifiedName(Ctx, Name, NameKind, RedeclarationOnly);
+ if (R || RedeclarationOnly)
+ return std::make_pair(true, R);
+ }
if (Ctx->getParent() != Ctx->getLexicalParent()) {
// It is out of line defined C++ method or struct, we continue
// doing name lookup in parent context. Once we will find namespace
@@ -611,8 +612,8 @@ Sema::CppLookupName(Scope *S, DeclarationName Name,
// using-directives later.
for (OutOfLineCtx = Ctx; OutOfLineCtx && !OutOfLineCtx->isFileContext();
OutOfLineCtx = OutOfLineCtx->getParent()) {
- if ((R = LookupQualifiedName(OutOfLineCtx, Name, NameKind,
- RedeclarationOnly)))
+ R = LookupQualifiedName(OutOfLineCtx, Name, NameKind, RedeclarationOnly);
+ if (R || RedeclarationOnly)
return std::make_pair(true, R);
}
}