ccls/tests/templates/template_func_usage_folded_into_one.cc

40 lines
768 B
C++
Raw Normal View History

2017-03-05 22:49:23 +00:00
template<typename T>
static int foo() {
return 3;
}
int a = foo<int>();
int b = foo<bool>();
// TODO: put template foo inside a namespace
// TODO: put template foo inside a template class inside a namespace
/*
OUTPUT:
{
2017-03-07 18:17:49 +00:00
"funcs": [{
2017-03-05 22:49:23 +00:00
"id": 0,
"usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#",
"short_name": "foo",
"qualified_name": "foo",
2017-04-05 08:06:18 +00:00
"definition": "2:12",
"uses": ["2:12", "6:9", "7:9"]
2017-03-05 22:49:23 +00:00
}],
2017-03-07 18:17:49 +00:00
"vars": [{
2017-03-05 22:49:23 +00:00
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
2017-04-05 08:06:18 +00:00
"definition": "6:5",
"uses": ["6:5"]
2017-03-05 22:49:23 +00:00
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
2017-04-05 08:06:18 +00:00
"definition": "7:5",
"uses": ["7:5"]
2017-03-05 22:49:23 +00:00
}]
}
2017-03-07 18:17:49 +00:00
*/