brintos

brintos / llvm-project-archived public Read only

0
0
Text · 988 B · 07b0cfb Raw
28 lines · cpp
1namespace std {2  template<typename RandomAccessIterator>3  void sort(RandomAccessIterator first, RandomAccessIterator last);4 5  template<class X, class Y>6  X* dyn_cast(Y *Val);7}8 9class Foo {10public:11  template<typename T> T &getAs();12};13 14template <typename T, typename U, typename V>15V doSomething(T t, const U &u, V *v) { return V(); }16 17void f() {18  std::sort(1, 2);19  Foo().getAs<int>();20  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-2):8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s21  // CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)22  // CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>23  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-4):9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s24  // CHECK-CC2: getAs<<#typename T#>>()25  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-6):22 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s26  // CHECK-CC3: [#V#]doSomething(<#T t#>, <#const U &u#>, <#V *v#>)27}28