[Issue 24259] New: ImportC: Can use -> operator on non-pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 24 08:38:05 UTC 2023


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

          Issue ID: 24259
           Summary: ImportC: Can use -> operator on non-pointer
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid, ImportC
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

Found in the reduced test case of issue 24257:

```
typedef struct { int m; } S;

void f(void)
{
    S s;
    if (s->m) {}
}
```

dmd accepts, while gcc says:

```
error: invalid type argument of ‘->’ (have ‘S’)
if (s->m) {}
```

--


More information about the Digitalmars-d-bugs mailing list