]> granicus.if.org Git - clang/commitdiff
Move code completion for qualified name lookup (foo::) to
authorDouglas Gregor <dgregor@apple.com>
Thu, 14 Jan 2010 03:35:48 +0000 (03:35 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 14 Jan 2010 03:35:48 +0000 (03:35 +0000)
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

lib/Sema/SemaCodeComplete.cpp
lib/Sema/SemaLookup.cpp

index c23648dfb95bc94b108470cb793e40676d13cabe..f7f5fe3b4dde27d36b439f79607abd8a2fe82c0d 100644 (file)
@@ -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.
index 88da7e8d5cc46bd7d1c3c2d8e4f22b78ab375bd6..d7ee95896379c3e9577ee2c36cf6b739b72b8a65 100644 (file)
@@ -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;
     }