diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-27 04:21:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-27 04:21:56 +0000 |
commit | fdca4a7967e3dd575f725edb33a8078314df8093 (patch) | |
tree | 6e3751872b895bac04c0720ad36aee6bee065043 /clang/lib | |
parent | 9eac931b5f29ca0353027bdacb2cc7fe0be9084a (diff) | |
download | bcm5719-llvm-fdca4a7967e3dd575f725edb33a8078314df8093.tar.gz bcm5719-llvm-fdca4a7967e3dd575f725edb33a8078314df8093.zip |
Tests and fixes for templates declared within (non-template)
classes. Test case from Anders Carlsson, fix from Piotr Rak!
llvm-svn: 67817
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 616ee3dd932..770f9301e61 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/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); } } |