ccls/tests/usage/func_called_from_template.cc

71 lines
1.6 KiB
C++
Raw Normal View History

2017-04-10 05:34:06 +00:00
void called();
template <typename T>
void caller() {
called();
}
void foo() {
caller<int>();
}
/*
// NOTE: without caller<int>() instantation caller() is never visited so
// called() is never referenced.
OUTPUT:
{
2017-12-12 05:15:37 +00:00
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
2017-04-10 05:34:06 +00:00
"funcs": [{
"id": 0,
2017-12-02 01:07:03 +00:00
"is_operator": false,
2017-04-10 05:34:06 +00:00
"usr": "c:@F@called#",
"short_name": "called",
"detailed_name": "void called()",
"hover": "void called()",
"declarations": [{
"spelling": "1:6-1:12",
"extent": "1:1-1:14",
2017-12-12 05:15:37 +00:00
"content": "void called()",
"param_spellings": []
}],
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-12 05:15:37 +00:00
"derived": [],
"locals": [],
"callers": ["1@5:3-5:9"],
"callees": []
2017-04-10 05:34:06 +00:00
}, {
"id": 1,
2017-12-02 01:07:03 +00:00
"is_operator": false,
2017-04-10 05:34:06 +00:00
"usr": "c:@FT@>1#Tcaller#v#",
"short_name": "caller",
"detailed_name": "void caller()",
"hover": "void caller()",
2017-12-12 05:15:37 +00:00
"declarations": [],
2017-04-10 05:34:06 +00:00
"definition_spelling": "4:6-4:12",
"definition_extent": "4:1-6:2",
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-12 05:15:37 +00:00
"derived": [],
"locals": [],
2017-04-10 05:34:06 +00:00
"callers": ["2@9:3-9:9"],
"callees": ["0@5:3-5:9"]
2017-04-10 05:34:06 +00:00
}, {
"id": 2,
2017-12-02 01:07:03 +00:00
"is_operator": false,
2017-04-10 05:34:06 +00:00
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"hover": "void foo()",
2017-12-12 05:15:37 +00:00
"declarations": [],
2017-04-10 05:34:06 +00:00
"definition_spelling": "8:6-8:9",
"definition_extent": "8:1-10:2",
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-12 05:15:37 +00:00
"derived": [],
"locals": [],
"callers": [],
"callees": ["1@9:3-9:9"]
2017-12-12 05:15:37 +00:00
}],
"vars": []
2017-04-10 05:34:06 +00:00
}
*/