ccls/tests/templates/template_func_usage_folded_into_one.cc
Jacob Dufault 07c984d6c7 - Add type information to qualified_name, remove hover.
- Allow tests to automatically update their expecatations
2017-04-14 21:53:10 -07:00

43 lines
957 B
C++

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:
{
"funcs": [{
"id": 0,
"usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#",
"short_name": "foo",
"qualified_name": "int foo()",
"definition_spelling": "2:12-2:15",
"definition_extent": "2:1-4:2",
"callers": ["-1@6:9-6:12", "-1@7:9-7:12"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "int a",
"definition_spelling": "6:5-6:6",
"definition_extent": "6:1-6:19",
"uses": ["6:5-6:6"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "int b",
"definition_spelling": "7:5-7:6",
"definition_extent": "7:1-7:20",
"uses": ["7:5-7:6"]
}]
}
*/