summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-06 20:19:47 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-06 20:19:47 +0000
commitc01890e1cc4c2cd884e7ea896f0310dc9eb720d7 (patch)
treebc76fe629ea461f7084e70788bd6de1c66e9919f /clang
parent2cb6c3067391a533915186f674645a7cc393af4e (diff)
downloadbcm5719-llvm-c01890e1cc4c2cd884e7ea896f0310dc9eb720d7.tar.gz
bcm5719-llvm-c01890e1cc4c2cd884e7ea896f0310dc9eb720d7.zip
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. llvm-svn: 100558
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp5
-rw-r--r--clang/test/CodeCompletion/call.cpp1
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index ced2e78c087..beed0ed2b6c 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -2260,9 +2260,8 @@ void Sema::CodeCompleteCall(Scope *S, ExprTy *FnIn,
}
}
- if (Results.empty())
- CodeCompleteOrdinaryName(S, CCC_Expression);
- else
+ CodeCompleteOrdinaryName(S, CCC_Expression);
+ if (!Results.empty())
CodeCompleter->ProcessOverloadCandidates(*this, NumArgs, Results.data(),
Results.size());
}
diff --git a/clang/test/CodeCompletion/call.cpp b/clang/test/CodeCompletion/call.cpp
index 04d2a2f0c98..1df958ed2cc 100644
--- a/clang/test/CodeCompletion/call.cpp
+++ b/clang/test/CodeCompletion/call.cpp
@@ -18,6 +18,7 @@ void f();
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#>)
OpenPOWER on IntegriCloud