freebsd-nq/test/CodeCompletion/function-templates.cpp

24 lines
693 B
C++
Raw Normal View History

2009-10-14 18:03:49 +00:00
namespace std {
template<typename RandomAccessIterator>
void sort(RandomAccessIterator first, RandomAccessIterator last);
template<class X, class Y>
X* dyn_cast(Y *Val);
}
2009-12-15 18:49:47 +00:00
class Foo {
public:
template<typename T> T &getAs();
};
2009-10-14 18:03:49 +00:00
void f() {
2009-12-15 18:49:47 +00:00
std::sort(1, 2);
Foo().getAs<int>();
2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:15:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
2009-10-14 18:03:49 +00:00
// CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
2009-12-15 18:49:47 +00:00
// CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>
2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:16:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
2009-12-15 18:49:47 +00:00
// CHECK-CC2: getAs<<#typename T#>>()
)
2009-10-14 18:03:49 +00:00