| 1 |
template<typename T> |
| 2 |
struct Foo { |
| 3 |
static int foo() { |
| 4 |
return 3; |
| 5 |
} |
| 6 |
}; |
| 7 |
|
| 8 |
int a = Foo<int>::foo(); |
| 9 |
int b = Foo<bool>::foo(); |
| 10 |
|
| 11 |
/* |
| 12 |
OUTPUT: |
| 13 |
{ |
| 14 |
"includes": [], |
| 15 |
"skipped_ranges": [], |
| 16 |
"usr2func": [{ |
| 17 |
"usr": 8340731781048851399, |
| 18 |
"detailed_name": "static int Foo::foo()", |
| 19 |
"qual_name_offset": 11, |
| 20 |
"short_name": "foo", |
| 21 |
"spell": "3:14-3:17|3:3-5:4|1026|-1", |
| 22 |
"bases": [], |
| 23 |
"vars": [], |
| 24 |
"callees": [], |
| 25 |
"kind": 254, |
| 26 |
"parent_kind": 23, |
| 27 |
"storage": 0, |
| 28 |
"declarations": [], |
| 29 |
"derived": [], |
| 30 |
"uses": ["8:19-8:22|36|-1", "9:20-9:23|36|-1"] |
| 31 |
}], |
| 32 |
"usr2type": [{ |
| 33 |
"usr": 452, |
| 34 |
"detailed_name": "", |
| 35 |
"qual_name_offset": 0, |
| 36 |
"short_name": "", |
| 37 |
"bases": [], |
| 38 |
"funcs": [], |
| 39 |
"types": [], |
| 40 |
"vars": [], |
| 41 |
"alias_of": 0, |
| 42 |
"kind": 0, |
| 43 |
"parent_kind": 0, |
| 44 |
"declarations": [], |
| 45 |
"derived": [], |
| 46 |
"instances": [16721564935990383768, 12028309045033782423], |
| 47 |
"uses": [] |
| 48 |
}, { |
| 49 |
"usr": 10528472276654770367, |
| 50 |
"detailed_name": "struct Foo {}", |
| 51 |
"qual_name_offset": 7, |
| 52 |
"short_name": "Foo", |
| 53 |
"spell": "2:8-2:11|2:1-6:2|2|-1", |
| 54 |
"bases": [], |
| 55 |
"funcs": [8340731781048851399], |
| 56 |
"types": [14929630827782508810], |
| 57 |
"vars": [], |
| 58 |
"alias_of": 0, |
| 59 |
"kind": 23, |
| 60 |
"parent_kind": 1, |
| 61 |
"declarations": [], |
| 62 |
"derived": [], |
| 63 |
"instances": [], |
| 64 |
"uses": ["8:9-8:12|4|-1", "9:9-9:12|4|-1"] |
| 65 |
}, { |
| 66 |
"usr": 14929630827782508810, |
| 67 |
"detailed_name": "T", |
| 68 |
"qual_name_offset": 0, |
| 69 |
"short_name": "", |
| 70 |
"bases": [], |
| 71 |
"funcs": [], |
| 72 |
"types": [], |
| 73 |
"vars": [], |
| 74 |
"alias_of": 0, |
| 75 |
"kind": 26, |
| 76 |
"parent_kind": 0, |
| 77 |
"declarations": ["1:19-1:20|1:10-1:20|1025|-1"], |
| 78 |
"derived": [], |
| 79 |
"instances": [], |
| 80 |
"uses": [] |
| 81 |
}], |
| 82 |
"usr2var": [{ |
| 83 |
"usr": 12028309045033782423, |
| 84 |
"detailed_name": "int b", |
| 85 |
"qual_name_offset": 4, |
| 86 |
"short_name": "b", |
| 87 |
"hover": "int b = Foo<bool>::foo()", |
| 88 |
"spell": "9:5-9:6|9:1-9:25|2|-1", |
| 89 |
"type": 452, |
| 90 |
"kind": 13, |
| 91 |
"parent_kind": 1, |
| 92 |
"storage": 0, |
| 93 |
"declarations": [], |
| 94 |
"uses": [] |
| 95 |
}, { |
| 96 |
"usr": 16721564935990383768, |
| 97 |
"detailed_name": "int a", |
| 98 |
"qual_name_offset": 4, |
| 99 |
"short_name": "a", |
| 100 |
"hover": "int a = Foo<int>::foo()", |
| 101 |
"spell": "8:5-8:6|8:1-8:24|2|-1", |
| 102 |
"type": 452, |
| 103 |
"kind": 13, |
| 104 |
"parent_kind": 1, |
| 105 |
"storage": 0, |
| 106 |
"declarations": [], |
| 107 |
"uses": [] |
| 108 |
}] |
| 109 |
} |
| 110 |
*/ |