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`
Replacing `my_long` with `long` works: void fn2() { long x = (long) (fn1) (); }
@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
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