Closed
Description
// clang -cc1 -ast-dump -fblocks /tmp/t.c
int (^a)(int, int) = ^(int, undefine b) {
return 1;
};
The BlockDecl
AST node looks like below:
-BlockDecl 0x5608ac620da0 <line:4:22, line:6:1> line:4:22
| |-ParmVarDecl 0x5608ac620e38 <col:24> col:27 'int'
| |-ParmVarDecl 0x5608ac620ed0 <col:29, col:38> col:38 invalid b 'int'
| |-CompoundStmt 0x5608ac620fe8 <col:41, line:6:1>
| | `-ReturnStmt 0x5608ac620fd8 <line:5:4, col:11>
| | `-IntegerLiteral 0x5608ac620fb8 <col:11> 'int' 1
| `-ParmVarDecl 0x5608ac620ed0 <line:4:29, col:38> col:38 invalid b 'int'
two issues:
-
- the invalid bit of
BlockDecl
is not set, we should set it because of its invalidParmDecl
- the invalid bit of
-
- The ast-dumper seems to emit a duplicated
ParmVarDecl
for b
- The ast-dumper seems to emit a duplicated