[cfe-commits] r100558 - in /cfe/trunk: lib/Sema/SemaCodeComplete.cpp test/CodeCompletion/call.cpp
Douglas Gregor
dgregor at apple.com
Tue Apr 6 13:19:47 PDT 2010
Author: dgregor
Date: Tue Apr 6 15:19:47 2010
New Revision: 100558
URL: http://llvm.org/viewvc/llvm-project?rev=100558&view=rev
Log:
When code completion produces an overload set as its results (e.g.,
while we're completing in the middle of a function call), also produce
"ordinary" name results that show what can be typed at that point.
Modified:
cfe/trunk/lib/Sema/SemaCodeComplete.cpp
cfe/trunk/test/CodeCompletion/call.cpp
Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=100558&r1=100557&r2=100558&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Tue Apr 6 15:19:47 2010
@@ -2260,9 +2260,8 @@
}
}
- if (Results.empty())
- CodeCompleteOrdinaryName(S, CCC_Expression);
- else
+ CodeCompleteOrdinaryName(S, CCC_Expression);
+ if (!Results.empty())
CodeCompleter->ProcessOverloadCandidates(*this, NumArgs, Results.data(),
Results.size());
}
Modified: cfe/trunk/test/CodeCompletion/call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/call.cpp?rev=100558&r1=100557&r2=100558&view=diff
==============================================================================
--- cfe/trunk/test/CodeCompletion/call.cpp (original)
+++ cfe/trunk/test/CodeCompletion/call.cpp Tue Apr 6 15:19:47 2010
@@ -18,6 +18,7 @@
void test() {
f(Y(), 0, 0);
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CC1 %s
+ // CHECK-CC1: COMPLETION: Pattern : dynamic_cast<<#type-id#>>(<#expression#>)
// CHECK-CC1: f(N::Y y, <#int ZZ#>)
// CHECK-CC1-NEXT: f(int i, <#int j#>, int k)
// CHECK-CC1-NEXT: f(float x, <#float y#>)
More information about the cfe-commits
mailing list