Bug 24259 – ImportC: Can use -> operator on non-pointer

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-11-24T08:38:05Z
Last change time
2023-11-27T22:46:19Z
Keywords
accepts-invalid, ImportC
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2023-11-24T08:38:05Z
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) {} ```
Comment #1 by bugzilla — 2023-11-27T20:41:59Z
Fixing it by documenting it as an extension. It's a deliberate extension, I had simply forgotten about it.
Comment #2 by bugzilla — 2023-11-27T22:46:06Z