int fn1() { return 0; }
void fn2() { long x = (long) (fn1) (); }
Error: expression expected, not `long`
similar to issue 22876 but the PR to fix that doesn't seem to affect this
Comment #1 by dlang-bot — 2022-03-21T01:41:02Z
@WalterBright created dlang/dmd pull request #13850 "fix Issue 22904 - importC: syntax error for function call with casted…" fixing this issue:
- fix Issue 22904 - importC: syntax error for function call with casted result and parentheses around name
https://github.com/dlang/dmd/pull/13850
Comment #2 by dlang-bot — 2022-03-21T07:07:11Z
dlang/dmd pull request #13850 "fix Issue 22904 - importC: syntax error for function call with casted…" was merged into master:
- cd37055869faae678ca3f6c1b20d95da7f337613 by Walter Bright:
fix Issue 22904 - importC: syntax error for function call with casted result and parentheses around name
https://github.com/dlang/dmd/pull/13850
Comment #3 by duser — 2022-03-22T13:58:13Z
still gives an error with typedef types:
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 #4 by bugzilla — 2022-03-23T06:53:22Z
This is a different error message, and a different problem. Closing this and creating a new bug report for it.