ccls/tests/operators/operator.cc

106 lines
2.7 KiB
C++
Raw Normal View History

2017-12-02 01:10:21 +00:00
class Foo {
void operator()(int) { }
void operator()(bool);
int operator()(int a, int b);
};
2017-12-20 17:43:26 +00:00
Foo &operator += (const Foo&, const int&);
2017-12-02 01:10:21 +00:00
/*
OUTPUT:
{
2017-12-12 05:15:37 +00:00
"includes": [],
"skipped_by_preprocessor": [],
2017-12-02 01:10:21 +00:00
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"hover": "Foo",
2017-12-02 01:10:21 +00:00
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-5:2",
2017-12-12 05:15:37 +00:00
"parents": [],
"derived": [],
"types": [],
2017-12-02 01:10:21 +00:00
"funcs": [0, 1, 2],
2017-12-12 05:15:37 +00:00
"vars": [],
"instances": [],
2017-12-20 17:43:26 +00:00
"uses": ["1:7-1:10", "7:1-7:4", "7:25-7:28"]
2017-12-02 01:10:21 +00:00
}],
"funcs": [{
"id": 0,
"is_operator": true,
"usr": "c:@S@Foo@F@operator()#I#",
"short_name": "operator()",
"detailed_name": "void Foo::operator()(int)",
"hover": "void Foo::operator()(int)",
2017-12-12 05:15:37 +00:00
"declarations": [],
2017-12-02 01:10:21 +00:00
"definition_spelling": "2:8-2:18",
"definition_extent": "2:3-2:27",
2017-12-12 05:15:37 +00:00
"declaring_type": 0,
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-12 05:15:37 +00:00
"derived": [],
"locals": [],
"callers": [],
"callees": []
2017-12-02 01:10:21 +00:00
}, {
"id": 1,
"is_operator": true,
"usr": "c:@S@Foo@F@operator()#b#",
"short_name": "operator()",
"detailed_name": "void Foo::operator()(bool)",
"hover": "void Foo::operator()(bool)",
2017-12-02 01:10:21 +00:00
"declarations": [{
"spelling": "3:8-3:18",
"extent": "3:3-3:24",
"content": "void operator()(bool)",
"param_spellings": ["3:23-3:23"]
}],
2017-12-12 05:15:37 +00:00
"declaring_type": 0,
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-12 05:15:37 +00:00
"derived": [],
"locals": [],
"callers": [],
"callees": []
2017-12-02 01:10:21 +00:00
}, {
"id": 2,
"is_operator": true,
"usr": "c:@S@Foo@F@operator()#I#I#",
"short_name": "operator()",
"detailed_name": "int Foo::operator()(int, int)",
"hover": "int Foo::operator()(int, int)",
2017-12-02 01:10:21 +00:00
"declarations": [{
"spelling": "4:7-4:17",
"extent": "4:3-4:31",
"content": "int operator()(int a, int b)",
"param_spellings": ["4:22-4:23", "4:29-4:30"]
}],
2017-12-12 05:15:37 +00:00
"declaring_type": 0,
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-12 05:15:37 +00:00
"derived": [],
"locals": [],
"callers": [],
"callees": []
2017-12-02 01:10:21 +00:00
}, {
"id": 3,
"is_operator": true,
"usr": "c:@F@operator+=#&1$@S@Foo#&1I#",
"short_name": "operator+=",
"detailed_name": "Foo &operator+=(const Foo &, const int &)",
"hover": "Foo &operator+=(const Foo &, const int &)",
2017-12-02 01:10:21 +00:00
"declarations": [{
2017-12-20 17:43:26 +00:00
"spelling": "7:6-7:17",
"extent": "7:1-7:42",
"content": "Foo &operator += (const Foo&, const int&)",
"param_spellings": ["7:29-7:29", "7:41-7:41"]
2017-12-12 05:15:37 +00:00
}],
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-12 05:15:37 +00:00
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
2017-12-02 01:10:21 +00:00
}
*/