diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-31 19:02:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-31 19:02:00 +0000 |
commit | 1fbaeb196b5ddeb9b2b19ae66a16c89ad93746c4 (patch) | |
tree | 6e14e7fe2c22b903049981b9a8c8b2fc4abbe06b /clang/test/Index/index-templates.cpp | |
parent | bda8065107080adaa310186bc222545aefb920cf (diff) | |
download | bcm5719-llvm-1fbaeb196b5ddeb9b2b19ae66a16c89ad93746c4.tar.gz bcm5719-llvm-1fbaeb196b5ddeb9b2b19ae66a16c89ad93746c4.zip |
Add a libclang cursor kind, visitation support and USR support for C++
class templates.
llvm-svn: 112627
Diffstat (limited to 'clang/test/Index/index-templates.cpp')
-rw-r--r-- | clang/test/Index/index-templates.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Index/index-templates.cpp b/clang/test/Index/index-templates.cpp index 90e0c352bc0..777c66e1a5d 100644 --- a/clang/test/Index/index-templates.cpp +++ b/clang/test/Index/index-templates.cpp @@ -3,6 +3,12 @@ template<typename T, T Value, template<typename U, U ValU> class X> void f(X<T, Value> x); +template<typename T> class allocator; + +template<typename T, typename Alloc = allocator<T> > +class vector { +}; + // RUN: c-index-test -test-load-source all %s | FileCheck -check-prefix=CHECK-LOAD %s // CHECK-LOAD: index-templates.cpp:4:6: FunctionTemplate=f:4:6 Extent=[3:1 - 4:22] // CHECK-LOAD: index-templates.cpp:3:19: TemplateTypeParameter=T:3:19 (Definition) Extent=[3:19 - 3:20] @@ -13,6 +19,11 @@ void f(X<T, Value> x); // FIXME: Need the template declaration here. // FIXME: Need the template type parameter here // CHECK-LOAD: index-templates.cpp:4:13: DeclRefExpr=Value:3:24 Extent=[4:13 - 4:18] +// CHECK-LOAD: index-templates.cpp:6:28: ClassTemplate=allocator:6:28 Extent=[6:1 - 6:37] +// CHECK-LOAD: index-templates.cpp:6:19: TemplateTypeParameter=T:6:19 (Definition) Extent=[6:19 - 6:20] +// CHECK-LOAD: index-templates.cpp:9:7: ClassTemplate=vector:9:7 (Definition) Extent=[8:1 - 10:2] +// CHECK-LOAD: index-templates.cpp:8:19: TemplateTypeParameter=T:8:19 (Definition) Extent=[8:19 - 8:20] +// CHECK-LOAD: index-templates.cpp:8:31: TemplateTypeParameter=Alloc:8:31 (Definition) Extent=[8:31 - 8:36] // RUN: c-index-test -test-load-source-usrs all %s | FileCheck -check-prefix=CHECK-USRS %s // CHECK-USRS: index-templates.cpp c:@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22t0.0# Extent=[3:1 - 4:22] @@ -20,3 +31,6 @@ void f(X<T, Value> x); // CHECK-USRS: index-templates.cpp c:index-templates.cpp@82 Extent=[3:22 - 3:29] // CHECK-USRS: index-templates.cpp c:index-templates.cpp@91 Extent=[3:31 - 3:67] // 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] +// CHECK-USRS: index-templates.cpp c:@CT>1#T@allocator Extent=[6:1 - 6:37] +// CHECK-USRS: index-templates.cpp c:index-templates.cpp@171 Extent=[6:19 - 6:20] +// CHECK-USRS: index-templates.cpp c:@CT>2#T#T@vector Extent=[8:1 - 10:2] |