[Issue 23415] New: ImportC: typedef'd struct as const parameter "is not callable"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 14 22:33:51 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23415
Issue ID: 23415
Summary: ImportC: typedef'd struct as const parameter "is not
callable"
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: acehreli at yahoo.com
// c.c
typedef struct /* S_ */ {
int i;
} S;
void foo(const S s) {}
// d.d
import c;
void main() {
S s;
foo(s);
}
Error: function `c.foo(__tag46 s)` is not callable using argument types
`(__tag45)`
cannot pass argument `s` of type `__tag45` to parameter `__tag46 s`
Same issue if the parameter is 'const S *'.
The following are workarounds:
a) Uncomment S_ in c.c
b) Remove 'const' from the parameter
--
More information about the Digitalmars-d-bugs
mailing list