Bug 22904 – importC: syntax error for function call with casted result and parentheses around name

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-03-19T14:33:54Z
Last change time
2022-03-23T07:03:17Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser
See also
https://issues.dlang.org/show_bug.cgi?id=22912

Comments

Comment #0 by duser — 2022-03-19T14:33:54Z
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.