www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24259] New: ImportC: Can use -> operator on non-pointer

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 puremagic.com
          Reporter: dkorpel 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) {}
```

--
Nov 24 2023