[Issue 23023] New: ImportC: useless casts are erroneously forbidden
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 17 01:31:33 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23023
Issue ID: 23023
Summary: ImportC: useless casts are erroneously forbidden
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: me at yoplitein.net
The following is valid C:
```
long f1(void) { return 0; }
void f2(void) { (int)f1(); }
```
but ImportC rejects it with "`cast(int)f1()` has no effect"
Such code often appears in macro expansions.
--
More information about the Digitalmars-d-bugs
mailing list