xref: /minix3/external/bsd/llvm/dist/clang/test/CodeCompletion/templates.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc namespace std {
2*f4a2713aSLionel Sambuc   template<typename T>
3*f4a2713aSLionel Sambuc   class allocator {
4*f4a2713aSLionel Sambuc   public:
5*f4a2713aSLionel Sambuc     void in_base();
6*f4a2713aSLionel Sambuc   };
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc   template<typename T, typename Alloc = std::allocator<T> >
9*f4a2713aSLionel Sambuc   class vector : Alloc {
10*f4a2713aSLionel Sambuc   public:
11*f4a2713aSLionel Sambuc     void foo();
12*f4a2713aSLionel Sambuc     void stop();
13*f4a2713aSLionel Sambuc   };
14*f4a2713aSLionel Sambuc   template<typename Alloc> class vector<bool, Alloc>;
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc 
f()17*f4a2713aSLionel Sambuc void f() {
18*f4a2713aSLionel Sambuc   std::vector<int> v;
19*f4a2713aSLionel Sambuc   v.foo();
20*f4a2713aSLionel Sambuc   // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:18:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
21*f4a2713aSLionel Sambuc   // CHECK-CC1: allocator<<#typename T#>>
22*f4a2713aSLionel Sambuc   // CHECK-CC1-NEXT: vector<<#typename T#>{#, <#typename Alloc#>#}>
23*f4a2713aSLionel Sambuc   // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:5 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
24*f4a2713aSLionel Sambuc   // CHECK-CC2: foo
25*f4a2713aSLionel Sambuc   // CHECK-CC2: in_base
26*f4a2713aSLionel Sambuc   // CHECK-CC2: stop
27*f4a2713aSLionel Sambuc 
28*f4a2713aSLionel Sambuc 
29