summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-09 21:35:27 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-09 21:35:27 +0000
commit8caea94c742f2d3abc3444d699a7189241959c91 (patch)
treeb1b038bc0101cbb7917db4e4be8859e04f6a03fa /clang/lib/Sema/SemaCodeComplete.cpp
parent7307bff420fab3af68a1dc8bec246356d48e3659 (diff)
downloadbcm5719-llvm-8caea94c742f2d3abc3444d699a7189241959c91.tar.gz
bcm5719-llvm-8caea94c742f2d3abc3444d699a7189241959c91.zip
Make sure that we look into nested, transparent declaration contexts
when looking for a name within a given DeclContext. Now enumerators will show up in code-completion results. llvm-svn: 86591
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index c6323956cc9..072dfe9b73a 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -473,17 +473,24 @@ static unsigned CollectMemberLookupResults(DeclContext *Ctx,
for (DeclContext *CurCtx = Ctx->getPrimaryContext(); CurCtx;
CurCtx = CurCtx->getNextContext()) {
for (DeclContext::decl_iterator D = CurCtx->decls_begin(),
- DEnd = CurCtx->decls_end();
+ DEnd = CurCtx->decls_end();
D != DEnd; ++D) {
if (NamedDecl *ND = dyn_cast<NamedDecl>(*D))
Results.MaybeAddResult(Result(ND, Rank, 0, InBaseClass), CurContext);
+
+ // Visit transparent contexts inside this context.
+ if (DeclContext *InnerCtx = dyn_cast<DeclContext>(*D)) {
+ if (InnerCtx->isTransparentContext())
+ CollectMemberLookupResults(InnerCtx, Rank, CurContext, Visited,
+ Results, InBaseClass);
+ }
}
}
// Traverse the contexts of inherited classes.
if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(Ctx)) {
for (CXXRecordDecl::base_class_iterator B = Record->bases_begin(),
- BEnd = Record->bases_end();
+ BEnd = Record->bases_end();
B != BEnd; ++B) {
QualType BaseType = B->getType();
OpenPOWER on IntegriCloud