xref: /minix3/external/bsd/llvm/dist/clang/test/CodeCompletion/function-templates.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc namespace std {
2*f4a2713aSLionel Sambuc   template<typename RandomAccessIterator>
3*f4a2713aSLionel Sambuc   void sort(RandomAccessIterator first, RandomAccessIterator last);
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc   template<class X, class Y>
6*f4a2713aSLionel Sambuc   X* dyn_cast(Y *Val);
7*f4a2713aSLionel Sambuc }
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc class Foo {
10*f4a2713aSLionel Sambuc public:
11*f4a2713aSLionel Sambuc   template<typename T> T &getAs();
12*f4a2713aSLionel Sambuc };
13*f4a2713aSLionel Sambuc 
f()14*f4a2713aSLionel Sambuc void f() {
15*f4a2713aSLionel Sambuc   std::sort(1, 2);
16*f4a2713aSLionel Sambuc   Foo().getAs<int>();
17*f4a2713aSLionel Sambuc   // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:15:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
18*f4a2713aSLionel Sambuc   // CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
19*f4a2713aSLionel Sambuc   // CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>
20*f4a2713aSLionel Sambuc   // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:16:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
21*f4a2713aSLionel Sambuc   // CHECK-CC2: getAs<<#typename T#>>()
22*f4a2713aSLionel Sambuc )
23*f4a2713aSLionel Sambuc 
24