diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-18 23:21:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-18 23:21:38 +0000 |
commit | 63f07c55d58951574afe9bbb9f7cb3f92eecdd9b (patch) | |
tree | e637e94a7e083348edb2ad9ca4414c0b548183a8 /test/CodeCompletion/function-templates.cpp | |
parent | 56ff871ae74b1edccff44efe296f3167d694ce48 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion/function-templates.cpp')
-rw-r--r-- | test/CodeCompletion/function-templates.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeCompletion/function-templates.cpp b/test/CodeCompletion/function-templates.cpp new file mode 100644 index 0000000000..c9a893ec9c --- /dev/null +++ b/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:: + |