[Issue 24266] New: ImportC: struct initializer entry gets ignored

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 29 14:52:40 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24266

          Issue ID: 24266
           Summary: ImportC: struct initializer entry gets ignored
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

```C
struct S
{
    int context[4];
    int id;
};

int main()
{
    struct S tn = (struct S) {{0}, 4};
    __check(tn.id == 4);
    return 0;
}
```
The assert fails. Using -vcg-ast shows dmd completely ignores the '4':

```D
S tn = S([0, 0, 0, 0], );
```

--


More information about the Digitalmars-d-bugs mailing list