Douglas Gregor | fe72e9c | 2010-08-31 17:01:39 +0000 | [diff] [blame] | 1 | // Test is line- and column-sensitive. See run lines below. |
| 2 | |
| 3 | template<typename T, T Value, template<typename U, U ValU> class X> |
| 4 | void f(X<T, Value> x); |
| 5 | |
Douglas Gregor | 39d6f07 | 2010-08-31 19:02:00 +0000 | [diff] [blame] | 6 | template<typename T> class allocator; |
| 7 | |
| 8 | template<typename T, typename Alloc = allocator<T> > |
| 9 | class vector { |
| 10 | }; |
| 11 | |
Douglas Gregor | 74dbe64 | 2010-08-31 19:31:58 +0000 | [diff] [blame^] | 12 | template<typename T> |
| 13 | class vector<T*> { }; |
| 14 | |
Douglas Gregor | fe72e9c | 2010-08-31 17:01:39 +0000 | [diff] [blame] | 15 | // RUN: c-index-test -test-load-source all %s | FileCheck -check-prefix=CHECK-LOAD %s |
| 16 | // CHECK-LOAD: index-templates.cpp:4:6: FunctionTemplate=f:4:6 Extent=[3:1 - 4:22] |
| 17 | // CHECK-LOAD: index-templates.cpp:3:19: TemplateTypeParameter=T:3:19 (Definition) Extent=[3:19 - 3:20] |
| 18 | // CHECK-LOAD: index-templates.cpp:3:24: NonTypeTemplateParameter=Value:3:24 (Definition) Extent=[3:22 - 3:29] |
| 19 | // FIXME: Need the template type parameter here |
| 20 | // CHECK-LOAD: index-templates.cpp:3:66: TemplateTemplateParameter=X:3:66 (Definition) Extent=[3:31 - 3:67] |
| 21 | // CHECK-LOAD: index-templates.cpp:4:20: ParmDecl=x:4:20 (Definition) Extent=[4:8 - 4:21] |
| 22 | // FIXME: Need the template declaration here. |
| 23 | // FIXME: Need the template type parameter here |
| 24 | // CHECK-LOAD: index-templates.cpp:4:13: DeclRefExpr=Value:3:24 Extent=[4:13 - 4:18] |
Douglas Gregor | 39d6f07 | 2010-08-31 19:02:00 +0000 | [diff] [blame] | 25 | // CHECK-LOAD: index-templates.cpp:6:28: ClassTemplate=allocator:6:28 Extent=[6:1 - 6:37] |
| 26 | // CHECK-LOAD: index-templates.cpp:6:19: TemplateTypeParameter=T:6:19 (Definition) Extent=[6:19 - 6:20] |
| 27 | // CHECK-LOAD: index-templates.cpp:9:7: ClassTemplate=vector:9:7 (Definition) Extent=[8:1 - 10:2] |
| 28 | // CHECK-LOAD: index-templates.cpp:8:19: TemplateTypeParameter=T:8:19 (Definition) Extent=[8:19 - 8:20] |
| 29 | // CHECK-LOAD: index-templates.cpp:8:31: TemplateTypeParameter=Alloc:8:31 (Definition) Extent=[8:31 - 8:36] |
Douglas Gregor | 74dbe64 | 2010-08-31 19:31:58 +0000 | [diff] [blame^] | 30 | // CHECK-LOAD: index-templates.cpp:13:7: ClassTemplatePartialSpecialization=vector:13:7 (Definition) Extent=[12:1 - 13:21] |
| 31 | // CHECK-LOAD: index-templates.cpp:12:19: TemplateTypeParameter=T:12:19 (Definition) Extent=[12:19 - 12:20] |
| 32 | // FIXME: Need the template type parameter here |
Douglas Gregor | fe72e9c | 2010-08-31 17:01:39 +0000 | [diff] [blame] | 33 | |
| 34 | // RUN: c-index-test -test-load-source-usrs all %s | FileCheck -check-prefix=CHECK-USRS %s |
| 35 | // CHECK-USRS: index-templates.cpp c:@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22t0.0# Extent=[3:1 - 4:22] |
| 36 | // CHECK-USRS: index-templates.cpp c:index-templates.cpp@79 Extent=[3:19 - 3:20] |
| 37 | // CHECK-USRS: index-templates.cpp c:index-templates.cpp@82 Extent=[3:22 - 3:29] |
| 38 | // CHECK-USRS: index-templates.cpp c:index-templates.cpp@91 Extent=[3:31 - 3:67] |
| 39 | // CHECK-USRS: index-templates.cpp c:index-templates.cpp@136@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22t0.0#@x Extent=[4:8 - 4:21] |
Douglas Gregor | 39d6f07 | 2010-08-31 19:02:00 +0000 | [diff] [blame] | 40 | // CHECK-USRS: index-templates.cpp c:@CT>1#T@allocator Extent=[6:1 - 6:37] |
| 41 | // CHECK-USRS: index-templates.cpp c:index-templates.cpp@171 Extent=[6:19 - 6:20] |
| 42 | // CHECK-USRS: index-templates.cpp c:@CT>2#T#T@vector Extent=[8:1 - 10:2] |
Douglas Gregor | 74dbe64 | 2010-08-31 19:31:58 +0000 | [diff] [blame^] | 43 | // CHECK-USRS: index-templates.cpp c:index-templates.cpp@264@CP>1#T@vector Extent=[12:1 - 13:21] |
| 44 | // CHECK-USRS: index-templates.cpp c:index-templates.cpp@282 Extent=[12:19 - 12:20] |