typedef long my_long;
int fn1() { return 0; }
void fn2() { long x = (my_long) (fn1) (); }
Error: function expected before `()`, not `cast(long)& fn1` of type `long`
Comment #1 by bugzilla — 2022-03-23T06:58:24Z
Replacing `my_long` with `long` works:
void fn2() { long x = (long) (fn1) (); }
Comment #2 by dlang-bot — 2022-03-23T07:25:51Z
@WalterBright created dlang/dmd pull request #13872 "fix Issue 22912 - importC: syntax error for function call with cast a…" fixing this issue:
- fix Issue 22912 - importC: syntax error for function call with cast and typedef and parentheses around name
https://github.com/dlang/dmd/pull/13872
Comment #3 by dlang-bot — 2022-03-23T09:19:48Z
dlang/dmd pull request #13872 "fix Issue 22912 - importC: syntax error for function call with cast a…" was merged into master:
- a36c45ed8fe865386729cd52ca080760678f93bc by Walter Bright:
fix Issue 22912 - importC: syntax error for function call with cast and typedef and parentheses around name
https://github.com/dlang/dmd/pull/13872