2018-03-31 03:16:33 +00:00
|
|
|
template <class T>
|
|
|
|
struct C {
|
|
|
|
T x;
|
|
|
|
void bar();
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
void foo() {
|
|
|
|
C<T> d;
|
|
|
|
d.x; // spelling range is empty, use cursor extent for range
|
|
|
|
d.bar(); // spelling range is empty, use cursor extent for range
|
|
|
|
|
|
|
|
auto e = new C<T>;
|
|
|
|
e->x; // `x` seems not exposed by libclang
|
|
|
|
e->bar(); // `bar` seems not exposed by libclang
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
EXTRA_FLAGS:
|
|
|
|
-fms-extensions
|
|
|
|
-fms-compatibility
|
|
|
|
-fdelayed-template-parsing
|
|
|
|
|
|
|
|
OUTPUT:
|
|
|
|
{
|
|
|
|
"includes": [],
|
|
|
|
"skipped_by_preprocessor": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"usr2func": [{
|
|
|
|
"usr": 6875364467121018690,
|
|
|
|
"detailed_name": "void foo()",
|
|
|
|
"qual_name_offset": 5,
|
|
|
|
"short_name": "foo",
|
|
|
|
"kind": 12,
|
|
|
|
"storage": 1,
|
|
|
|
"declarations": [],
|
|
|
|
"spell": "8:6-8:9|0|1|2",
|
|
|
|
"extent": "8:1-8:11|0|1|0",
|
|
|
|
"declaring_type": 0,
|
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
|
|
|
"vars": [],
|
|
|
|
"uses": [],
|
|
|
|
"callees": []
|
|
|
|
}, {
|
|
|
|
"usr": 8905286151237717330,
|
|
|
|
"detailed_name": "void C::bar()",
|
|
|
|
"qual_name_offset": 5,
|
|
|
|
"short_name": "bar",
|
|
|
|
"kind": 6,
|
|
|
|
"storage": 1,
|
|
|
|
"declarations": ["4:8-4:11|8402783583255987702|2|1"],
|
|
|
|
"declaring_type": 8402783583255987702,
|
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
|
|
|
"vars": [],
|
|
|
|
"uses": [],
|
|
|
|
"callees": []
|
|
|
|
}],
|
|
|
|
"usr2type": [{
|
2018-03-31 03:16:33 +00:00
|
|
|
"usr": 8402783583255987702,
|
|
|
|
"detailed_name": "C",
|
2018-04-06 00:00:07 +00:00
|
|
|
"qual_name_offset": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"short_name": "C",
|
|
|
|
"kind": 5,
|
|
|
|
"declarations": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"spell": "2:8-2:9|0|1|2",
|
|
|
|
"extent": "2:1-5:2|0|1|0",
|
|
|
|
"alias_of": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
|
|
|
"types": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"funcs": [8905286151237717330],
|
2018-05-29 00:03:14 +00:00
|
|
|
"vars": [{
|
|
|
|
"L": 5866801090710377175,
|
|
|
|
"R": -1
|
|
|
|
}],
|
2018-03-31 03:16:33 +00:00
|
|
|
"instances": [],
|
|
|
|
"uses": []
|
|
|
|
}, {
|
|
|
|
"usr": 14750650276757822712,
|
|
|
|
"detailed_name": "T",
|
2018-04-06 00:00:07 +00:00
|
|
|
"qual_name_offset": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"short_name": "T",
|
|
|
|
"kind": 26,
|
|
|
|
"declarations": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"spell": "1:17-1:18|0|1|2",
|
|
|
|
"extent": "1:11-1:18|0|1|0",
|
|
|
|
"alias_of": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
|
|
|
"types": [],
|
|
|
|
"funcs": [],
|
|
|
|
"vars": [],
|
|
|
|
"instances": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"uses": ["3:3-3:4|0|1|4"]
|
2018-03-31 03:16:33 +00:00
|
|
|
}],
|
2018-04-30 04:49:03 +00:00
|
|
|
"usr2var": [{
|
2018-03-31 03:16:33 +00:00
|
|
|
"usr": 5866801090710377175,
|
|
|
|
"detailed_name": "T C::x",
|
2018-04-06 00:00:07 +00:00
|
|
|
"qual_name_offset": 2,
|
2018-03-31 03:16:33 +00:00
|
|
|
"short_name": "x",
|
|
|
|
"declarations": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"spell": "3:5-3:6|8402783583255987702|2|2",
|
|
|
|
"extent": "3:3-3:6|8402783583255987702|2|0",
|
|
|
|
"type": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"uses": [],
|
|
|
|
"kind": 8,
|
|
|
|
"storage": 0
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
*/
|