The addition of a symbol table of typedefs to ImportC compilation raises a problem with imported files - the imported typedefs will be invisible during the parse.
The solution is when an __import is seen, the current C compilation should be paused while the imported file is parsed. The typedef symbol table thus generated should then be made available to the importer.
What to do about typedefs from imported D modules is a bit trickier. The workaround would be for the C importer to redeclare the typedef. Another possibility is to add a __cast keyword to distinguish cast expressions. (Or maybe support C++'s static_cast instead.)
Comment #1 by bugzilla — 2023-04-02T01:56:00Z
Example:
// test.c(2): Error: found `1` when expecting `]`
// test.c(2): Error: `=`, `;` or `,` expected to end declaration instead of `]`
__import core.stdc.stdint;
char cs[(int32_t)1];
Comment #2 by robert.schadek — 2024-12-13T19:21:46Z