[cfe-commits] r93421 - in /cfe/trunk/lib/Sema: SemaCodeComplete.cpp SemaLookup.cpp
Douglas Gregor
dgregor at apple.com
Wed Jan 13 19:35:48 PST 2010
Author: dgregor
Date: Wed Jan 13 21:35:48 2010
New Revision: 93421
URL: http://llvm.org/viewvc/llvm-project?rev=93421&view=rev
Log:
Move code completion for qualified name lookup (foo::) to
LookupVisibleDecls. Also, a function does not hide another function.
Modified:
cfe/trunk/lib/Sema/SemaCodeComplete.cpp
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=93421&r1=93420&r2=93421&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Wed Jan 13 21:35:48 2010
@@ -2354,7 +2354,8 @@
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.
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=93421&r1=93420&r2=93421&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Wed Jan 13 21:35:48 2010
@@ -1942,6 +1942,12 @@
(*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;
}
More information about the cfe-commits
mailing list