ccls/tests/macros/foo.cc

64 lines
1.4 KiB
C++
Raw Normal View History

#define A 5
#define DISALLOW(type) type(type&&) = delete;
struct Foo {
DISALLOW(Foo);
};
int x = A;
/*
OUTPUT:
{
2017-12-12 05:15:37 +00:00
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "4:8-4:11",
"definition_extent": "4:1-6:2",
2017-12-12 05:15:37 +00:00
"parents": [],
"derived": [],
"types": [],
2017-12-19 04:39:45 +00:00
"funcs": [],
2017-12-12 05:15:37 +00:00
"vars": [],
"instances": [],
2017-12-19 04:39:45 +00:00
"uses": ["4:8-4:11"]
}],
2017-12-19 04:39:45 +00:00
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@x",
"short_name": "x",
"detailed_name": "int x",
"definition_spelling": "8:5-8:6",
"definition_extent": "8:1-8:10",
"is_local": false,
"is_macro": false,
"uses": ["8:5-8:6"]
}, {
"id": 1,
"usr": "c:foo.cc@8@macro@A",
"short_name": "A",
"detailed_name": "#define A 5",
"definition_spelling": "1:9-1:10",
"definition_extent": "1:9-1:12",
"is_local": false,
2017-06-29 06:28:29 +00:00
"is_macro": true,
"uses": ["1:9-1:10", "8:9-8:10"]
}, {
"id": 2,
"usr": "c:foo.cc@21@macro@DISALLOW",
"short_name": "DISALLOW",
"detailed_name": "#define DISALLOW(type) type(type&&) = delete;",
"definition_spelling": "2:9-2:17",
"definition_extent": "2:9-2:46",
"is_local": false,
2017-06-29 06:28:29 +00:00
"is_macro": true,
"uses": ["2:9-2:17", "5:3-5:11"]
}]
}
*/