www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22858] New: [REG2.099] Incorrect alignment of void*[0]

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

          Issue ID: 22858
           Summary: [REG2.099] Incorrect alignment of void*[0]
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: johanengelen weka.io

Testcase:
```
struct S {
  int a;
  void*[0] arr;
}

static assert (S.arr.offsetof % size_t.sizeof == 0); // aligned pointer?
```

Alignment is correct for 2.097, but is incorrect for 2.099. (Tested with LDC
1.27 and 1.29-beta). Could be a regression of 2.098 or 2.099.

--
Mar 07 2022