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