Eric Liu | 3e0051b | 2018-07-20 08:08:56 +0000 | [diff] [blame] | 1 | template <typename T> |
| 2 | class Foo { |
| 3 | public: |
| 4 | void f(T t) {} |
| 5 | }; |
| 6 | |
| 7 | void g() { |
| 8 | Foo<int> foo; |
| 9 | foo.f(0); |
| 10 | } |
| 11 | |
Fangrui Song | f750f7f | 2018-09-23 08:23:48 +0000 | [diff] [blame] | 12 | template <typename T> |
| 13 | struct B {}; |
| 14 | |
| 15 | template <typename T> |
| 16 | struct D : B<T> {}; |
| 17 | |
Eric Liu | 3e0051b | 2018-07-20 08:08:56 +0000 | [diff] [blame] | 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# |
Fangrui Song | f750f7f | 2018-09-23 08:23:48 +0000 | [diff] [blame] | 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 |