summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeCompletion/call.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-22 15:41:20 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-22 15:41:20 +0000
commitcabea40ea3c9b97d213080618e612eb41bcc96e5 (patch)
tree1ed52237286dada0af0a8e70570a07062e6594f5 /clang/test/CodeCompletion/call.cpp
parent88e98fec708ec5be00a1709d66c5dee78352da85 (diff)
downloadbcm5719-llvm-cabea40ea3c9b97d213080618e612eb41bcc96e5.tar.gz
bcm5719-llvm-cabea40ea3c9b97d213080618e612eb41bcc96e5.zip
Implement code completion within a function call, triggered after the
opening parentheses and after each comma. We gather the set of visible overloaded functions, perform "partial" overloading based on the set of arguments that we have thus far, and return the still-viable results sorted by the likelihood that they will be the best candidate. Most of the changes in this patch are a refactoring of the overloading routines for a function call, since we needed to separate out the notion of building an overload set (common to code-completion and normal semantic analysis) and then what to do with that overload set. As part of this change, I've pushed explicit template arguments into a few more subroutines. There is still much more work to do in this area. Function templates won't be handled well (unless we happen to deduce all of the template arguments before we hit the completion point), nor will overloaded function-call operators or calls to member functions. llvm-svn: 82549
Diffstat (limited to 'clang/test/CodeCompletion/call.cpp')
-rw-r--r--clang/test/CodeCompletion/call.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/call.cpp b/clang/test/CodeCompletion/call.cpp
new file mode 100644
index 00000000000..4faff15c05a
--- /dev/null
+++ b/clang/test/CodeCompletion/call.cpp
@@ -0,0 +1,22 @@
+// RUN: clang-cc -fsyntax-only -code-completion-dump=1 %s -o - | FileCheck -check-prefix=CC1 %s &&
+// RUN: true
+void f(float x, float y);
+void f(int i, int j, int k);
+struct X { };
+void f(X);
+namespace N {
+ struct Y {
+ Y(int = 0);
+
+ operator int() const;
+ };
+ void f(Y y);
+}
+typedef N::Y Y;
+void f();
+
+void test() {
+ // CHECK-CC1: f : 0 : f(<#struct N::Y y#>)
+ // CHECK-NEXT-CC1: f : 0 : f(<#int i#>, <#int j#>, <#int k#>)
+ // CHECK-NEXT-CC1: f : 0 : f(<#float x#>, <#float y#>)
+ f(Y(),
OpenPOWER on IntegriCloud