| 1 |
namespace ns { |
| 2 |
template<typename T> |
| 3 |
struct Foo { |
| 4 |
template<typename R> |
| 5 |
static int foo() { |
| 6 |
return 3; |
| 7 |
} |
| 8 |
}; |
| 9 |
|
| 10 |
int a = Foo<int>::foo<float>(); |
| 11 |
int b = Foo<bool>::foo<double>(); |
| 12 |
} |
| 13 |
|
| 14 |
/* |
| 15 |
OUTPUT: |
| 16 |
{ |
| 17 |
"includes": [], |
| 18 |
"skipped_ranges": [], |
| 19 |
"usr2func": [{ |
| 20 |
"usr": 8221803074608342407, |
| 21 |
"detailed_name": "static int ns::Foo::foo()", |
| 22 |
"qual_name_offset": 11, |
| 23 |
"short_name": "foo", |
| 24 |
"spell": "5:16-5:19|5:5-7:6|1026|-1", |
| 25 |
"bases": [], |
| 26 |
"vars": [], |
| 27 |
"callees": [], |
| 28 |
"kind": 254, |
| 29 |
"parent_kind": 23, |
| 30 |
"storage": 0, |
| 31 |
"declarations": [], |
| 32 |
"derived": [], |
| 33 |
"uses": ["10:21-10:24|36|-1", "11:22-11:25|36|-1"] |
| 34 |
}], |
| 35 |
"usr2type": [{ |
| 36 |
"usr": 452, |
| 37 |
"detailed_name": "", |
| 38 |
"qual_name_offset": 0, |
| 39 |
"short_name": "", |
| 40 |
"bases": [], |
| 41 |
"funcs": [], |
| 42 |
"types": [], |
| 43 |
"vars": [], |
| 44 |
"alias_of": 0, |
| 45 |
"kind": 0, |
| 46 |
"parent_kind": 0, |
| 47 |
"declarations": [], |
| 48 |
"derived": [], |
| 49 |
"instances": [15768138241775955040, 3182917058194750998], |
| 50 |
"uses": [] |
| 51 |
}, { |
| 52 |
"usr": 404962309137154484, |
| 53 |
"detailed_name": "R", |
| 54 |
"qual_name_offset": 0, |
| 55 |
"short_name": "", |
| 56 |
"bases": [], |
| 57 |
"funcs": [], |
| 58 |
"types": [], |
| 59 |
"vars": [], |
| 60 |
"alias_of": 0, |
| 61 |
"kind": 26, |
| 62 |
"parent_kind": 0, |
| 63 |
"declarations": ["4:23-4:24|4:14-4:24|1|-1"], |
| 64 |
"derived": [], |
| 65 |
"instances": [], |
| 66 |
"uses": [] |
| 67 |
}, { |
| 68 |
"usr": 11072669167287398027, |
| 69 |
"detailed_name": "namespace ns {}", |
| 70 |
"qual_name_offset": 10, |
| 71 |
"short_name": "ns", |
| 72 |
"bases": [], |
| 73 |
"funcs": [], |
| 74 |
"types": [14042997404480181958], |
| 75 |
"vars": [{ |
| 76 |
"L": 15768138241775955040, |
| 77 |
"R": -1 |
| 78 |
}, { |
| 79 |
"L": 3182917058194750998, |
| 80 |
"R": -1 |
| 81 |
}], |
| 82 |
"alias_of": 0, |
| 83 |
"kind": 3, |
| 84 |
"parent_kind": 0, |
| 85 |
"declarations": ["1:11-1:13|1:1-12:2|1|-1"], |
| 86 |
"derived": [], |
| 87 |
"instances": [], |
| 88 |
"uses": [] |
| 89 |
}, { |
| 90 |
"usr": 14005287469305211602, |
| 91 |
"detailed_name": "T", |
| 92 |
"qual_name_offset": 0, |
| 93 |
"short_name": "", |
| 94 |
"bases": [], |
| 95 |
"funcs": [], |
| 96 |
"types": [], |
| 97 |
"vars": [], |
| 98 |
"alias_of": 0, |
| 99 |
"kind": 26, |
| 100 |
"parent_kind": 0, |
| 101 |
"declarations": ["2:21-2:22|2:12-2:22|1025|-1"], |
| 102 |
"derived": [], |
| 103 |
"instances": [], |
| 104 |
"uses": [] |
| 105 |
}, { |
| 106 |
"usr": 14042997404480181958, |
| 107 |
"detailed_name": "struct ns::Foo {}", |
| 108 |
"qual_name_offset": 7, |
| 109 |
"short_name": "Foo", |
| 110 |
"spell": "3:10-3:13|3:3-8:4|1026|-1", |
| 111 |
"bases": [], |
| 112 |
"funcs": [8221803074608342407], |
| 113 |
"types": [14005287469305211602], |
| 114 |
"vars": [], |
| 115 |
"alias_of": 0, |
| 116 |
"kind": 23, |
| 117 |
"parent_kind": 3, |
| 118 |
"declarations": [], |
| 119 |
"derived": [], |
| 120 |
"instances": [], |
| 121 |
"uses": ["10:11-10:14|4|-1", "11:11-11:14|4|-1"] |
| 122 |
}], |
| 123 |
"usr2var": [{ |
| 124 |
"usr": 3182917058194750998, |
| 125 |
"detailed_name": "int ns::b", |
| 126 |
"qual_name_offset": 4, |
| 127 |
"short_name": "b", |
| 128 |
"hover": "int ns::b = Foo<bool>::foo<double>()", |
| 129 |
"spell": "11:7-11:8|11:3-11:35|1026|-1", |
| 130 |
"type": 452, |
| 131 |
"kind": 13, |
| 132 |
"parent_kind": 3, |
| 133 |
"storage": 0, |
| 134 |
"declarations": [], |
| 135 |
"uses": [] |
| 136 |
}, { |
| 137 |
"usr": 15768138241775955040, |
| 138 |
"detailed_name": "int ns::a", |
| 139 |
"qual_name_offset": 4, |
| 140 |
"short_name": "a", |
| 141 |
"hover": "int ns::a = Foo<int>::foo<float>()", |
| 142 |
"spell": "10:7-10:8|10:3-10:33|1026|-1", |
| 143 |
"type": 452, |
| 144 |
"kind": 13, |
| 145 |
"parent_kind": 3, |
| 146 |
"storage": 0, |
| 147 |
"declarations": [], |
| 148 |
"uses": [] |
| 149 |
}] |
| 150 |
} |
| 151 |
*/ |