aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-14 03:35:48 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-14 03:35:48 +0000
commitdef9107059d460ada5f0eb3d58189c59122e3c3f (patch)
tree58303994ebc7deb84705b489afc7e5d8496b630b
parent651f3eec130099fb46e2ce2c8aee9d01531dc3b5 (diff)
Move code completion for qualified name lookup (foo::) to
LookupVisibleDecls. Also, a function does not hide another function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93421 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaCodeComplete.cpp3
-rw-r--r--lib/Sema/SemaLookup.cpp6
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index c23648dfb9..f7f5fe3b4d 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -2354,7 +2354,8 @@ void Sema::CodeCompleteQualifiedId(Scope *S, const CXXScopeSpec &SS,
return;
ResultBuilder Results(*this);
- CollectMemberLookupResults(Ctx, Ctx, Results);
+ CodeCompletionDeclConsumer Consumer(Results, CurContext);
+ LookupVisibleDecls(Ctx, LookupOrdinaryName, Consumer);
// The "template" keyword can follow "::" in the grammar, but only
// put it into the grammar if the nested-name-specifier is dependent.
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 88da7e8d5c..d7ee958963 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -1942,6 +1942,12 @@ NamedDecl *VisibleDeclsRecord::checkHidden(NamedDecl *ND) {
(*I)->getIdentifierNamespace() != IDNS)
continue;
+ // Functions and function templates overload rather than hide.
+ // FIXME: Look for hiding based on function signatures!
+ if ((*I)->isFunctionOrFunctionTemplate() &&
+ ND->isFunctionOrFunctionTemplate())
+ continue;
+
// We've found a declaration that hides this one.
return *I;
}