-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
I have two files:
bar.h(single-liner):
#define DEFINE_MY_FUNC(x) void bar##x(int y);
foo.h(two-liner):
#include "bar.h"
DEFINE_MY_FUNC(FOO)
With clang-rs, the entity corresponding to parameters of function "barFoo" is:
Entity {
kind: ParmDecl,
display_name: Some(
"y",
),
location: Some(
SourceLocation {
file: Some(
File {
path: "foo.h",
},
),
line: 2,
column: 1,
offset: 17,
},
),
}
With clang -Xclang -ast-dump=json foo.h, we get:
{
"id": "0x564483c5b7a0",
"kind": "ParmVarDecl",
"loc": {
"spellingLoc": {
"offset": 42,
"file": "./bar.h",
"line": 1,
"col": 43,
"tokLen": 1,
"includedFrom": {
"file": "foo.h"
}
},
"expansionLoc": {
"offset": 17,
"file": "foo.h",
"line": 2,
"col": 1,
"tokLen": 14
}
},
"range": {
"begin": {
"spellingLoc": {
"offset": 38,
"file": "./bar.h",
"line": 1,
"col": 39,
"tokLen": 3,
"includedFrom": {
"file": "foo.h"
}
},
"expansionLoc": {
"offset": 17,
"file": "foo.h",
"line": 2,
"col": 1,
"tokLen": 14
}
},
"end": {
"spellingLoc": {
"offset": 42,
"file": "./bar.h",
"line": 1,
"col": 43,
"tokLen": 1,
"includedFrom": {
"file": "foo.h"
}
},
"expansionLoc": {
"offset": 17,
"file": "foo.h",
"line": 2,
"col": 1,
"tokLen": 14
}
}
},
"name": "y",
"type": {
"qualType": "int"
}
}Is it a bug in clang-rs or am I missing something with my invocations. Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels