diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-09-16 22:38:47 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2023-09-17 12:41:11 +0100 |
| commit | 0fa8cf44f69dcb00dacf180d88ebfa09bc462120 (patch) | |
| tree | 99b05b6dad404a5008677de5b056adec44db24f2 /lib/libcxx/src | |
| parent | 28caaea0938e938de96cc66a49f670005a2df9d4 (diff) | |
| download | zig-0fa8cf44f69dcb00dacf180d88ebfa09bc462120.tar.gz zig-0fa8cf44f69dcb00dacf180d88ebfa09bc462120.zip | |
translate-c: do not translate macros which use arguments as struct/union/enum names
Consider this C macro:
```c
#define FOO(x) struct x
```
Previously, translate-c did not detect that the `x` in the body referred
to the argument, so wrongly translated this code as using the
nonexistent `struct_x`. Since undefined identifiers are noticed in
AstGen, this prevents the translated file from being usable at all.
translate-c now instead detects this case and emits an appropriate
compile error in the macro's place.
Diffstat (limited to 'lib/libcxx/src')
0 files changed, 0 insertions, 0 deletions
