www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24266] New: ImportC: struct initializer entry gets ignored

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 puremagic.com
          Reporter: dkorpel 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], );
```

--
Nov 29 2023