Bug 22921 – ImportC: initializing local with address of itself does not work in CTFE

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-03-24T18:29:43Z
Last change time
2024-12-13T19:21:39Z
Keywords
ImportC
Assigned to
No Owner
Creator
Walter Bright
Moved to GitHub: dmd#18092 →

Comments

Comment #0 by bugzilla — 2022-03-24T18:29:43Z
This does not compile: struct S { struct S *s; int first; int *last; }; int main() { struct S localS = { &localS, 0, &localS.first }; assertImpl(localS.s == &localS); assertImpl(localS.first == 0); assertImpl(localS.last == &localS.first); return 0; } _Static_assert(main() == 0, "Test");
Comment #1 by robert.schadek — 2024-12-13T19:21:39Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18092 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB