digitalmars.D.bugs - [Issue 22576] New: ImportC: cannot implicitly convert expression
- d-bugmail puremagic.com (30/30) Dec 06 2021 https://issues.dlang.org/show_bug.cgi?id=22576
https://issues.dlang.org/show_bug.cgi?id=22576 Issue ID: 22576 Summary: ImportC: cannot implicitly convert expression `S(0)` of type `S` to `int` in an S array Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: dave287091 gmail.com The following C program fails to compile: // compound.c typedef struct S { int x; } S; int main(int argc, char** argv){ S s = (S){0}; // ok S a0[] = {{0}}; // ok S a1[] = {(S){0}}; // Error: cannot implicitly convert expression `S(0)` of type `S` to `int` struct S a2[] = {(struct S){0}}; // Error: cannot implicitly convert expression `S(0)` of type `S` to `int` struct S a3[1] = {(struct S){0}}; // Error: cannot implicitly convert expression `S(0)` of type `S` to `int` } --
Dec 06 2021