[Issue 24303] New: anonymous struct problems when typedef'd in separate C files

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 27 02:55:18 UTC 2023


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

          Issue ID: 24303
           Summary: anonymous struct problems when typedef'd in separate C
                    files
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

Dennis 2023-12-12 23:04:37 UTC submitted:

Another example: (not sure if it's the same bug)

a.c
```C
typedef struct {} Slice;
struct Lang
{
    Slice *slices;
};
```

b.c
```C
typedef struct {} Slice;

struct Lang
{
    Slice *slices;
};

void langmap(struct Lang *self)
{
    Slice slice = *self->slices;
}
```

```
dmd a.c // works
dmd b.c // works
dmd b.c a.c // works
dmd a.c b.c // fails:
b.c(11): Error: cannot implicitly convert expression `*(*self).slices` of type
`__tag2` to `__tag3`
```

--


More information about the Digitalmars-d-bugs mailing list