summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeCompletion
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-18 23:21:38 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-18 23:21:38 +0000
commitce23bae4f82a4d2999f8bd502d8277fc3d0db8da (patch)
treec2744e50f692f18fdbb14f1794207aa6eab0f4e3 /clang/test/CodeCompletion
parent3f6ca389270770fd7d4beeaa3df27fb6b21c0ef4 (diff)
downloadbcm5719-llvm-ce23bae4f82a4d2999f8bd502d8277fc3d0db8da.tar.gz
bcm5719-llvm-ce23bae4f82a4d2999f8bd502d8277fc3d0db8da.zip
Make the construction of the code-completion string for a function
template smarter, by taking into account which function template parameters are deducible from the call arguments. For example, template<typename RandomAccessIterator> void sort(RandomAccessIterator first, RandomAccessIterator last); will have a code-completion string like sort({RandomAccessIterator first}, {RandomAccessIterator last}) since the template argument for its template parameter is deducible. On the other hand, template<class X, class Y> X* dyn_cast(Y *Val); will have a code-completion string like dyn_cast<{class X}>({Y *Val}) since the template type parameter X is not deducible from the function call. llvm-svn: 82306
Diffstat (limited to 'clang/test/CodeCompletion')
-rw-r--r--clang/test/CodeCompletion/function-templates.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/function-templates.cpp b/clang/test/CodeCompletion/function-templates.cpp
new file mode 100644
index 00000000000..c9a893ec9c2
--- /dev/null
+++ b/clang/test/CodeCompletion/function-templates.cpp
@@ -0,0 +1,16 @@
+// RUN: clang-cc -fsyntax-only -code-completion-dump=1 %s -o - | FileCheck -check-prefix=CC1 %s &&
+// RUN: true
+
+namespace std {
+ template<typename RandomAccessIterator>
+ void sort(RandomAccessIterator first, RandomAccessIterator last);
+
+ template<class X, class Y>
+ X* dyn_cast(Y *Val);
+}
+
+void f() {
+ // CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
+ // CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>)
+ std::
+
OpenPOWER on IntegriCloud