Clang Project

clang_source_code/test/Index/index-template-specialization.cpp
1template <typename T>
2class Foo {
3public:
4  void f(T t) {}
5};
6
7void g() {
8  Foo<int> foo;
9  foo.f(0);
10}
11
12template <typename T>
13struct B {};
14
15template <typename T>
16struct D : B<T> {};
17
18// FIXME: if c-index-test uses OrigD for symbol info, refererences below should
19// refer to template specialization decls.
20// RUN: env CINDEXTEST_INDEXIMPLICITTEMPLATEINSTANTIATIONS=1 c-index-test -index-file %s | FileCheck %s
21// CHECK: [indexDeclaration]: kind: c++-class-template | name: Foo
22// CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: f
23// CHECK-NEXT: [indexDeclaration]: kind: function | name: g
24// CHECK-NEXT: [indexEntityReference]: kind: c++-class-template | name: Foo | USR: c:@ST>1#T@Foo
25// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: f | USR: c:@ST>1#T@Foo@F@f#t0.0#
26
27// CHECK: [indexDeclaration]: kind: c++-class-template | name: D
28// CHECK-NEXT: <base>: kind: c++-class-template | name: B
29// CHECK-NEXT: [indexEntityReference]: kind: c++-class-template | name: B
30