Bug 22894 – importC: static struct initializer can't take address of own field

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-03-18T04:49:51Z
Last change time
2022-03-24T18:32:24Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser

Comments

Comment #0 by duser — 2022-03-18T04:49:51Z
struct queue { int *first; int **last; }; struct queue my_queue = { 0, &my_queue.first }; Error: static variable `my_queue` cannot be read at compile time
Comment #1 by dlang-bot — 2022-03-24T06:22:11Z
@WalterBright created dlang/dmd pull request #13881 "fix Issue 22894 - importC: static struct initializer can't take addre…" fixing this issue: - fix Issue 22894 - importC: static struct initializer can't take address of own field https://github.com/dlang/dmd/pull/13881
Comment #2 by dlang-bot — 2022-03-24T18:32:24Z
dlang/dmd pull request #13881 "fix Issue 22894 - importC: static struct initializer can't take addre…" was merged into master: - de15dc91c982cb1932843f31e5b4ee10b14463d1 by Walter Bright: fix Issue 22894 - importC: static struct initializer can't take address of own field https://github.com/dlang/dmd/pull/13881