www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22926] New: importC: can't use offsetof in array length

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

          Issue ID: 22926
           Summary: importC: can't use offsetof in array length
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC, rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: duser neet.fi
                CC: duser neet.fi

struct S { int x, y; };
char cs[ ((size_t)((char *)&((struct S *)0)->y - (char *)0)) ];

dmd v2.099.0:
  Error: dereference of invalid pointer `cast(S*)0LU`
current git master:
  Error: identifier or `(` expected

--
Mar 25 2022