Bug 24421 – expression `&B(A(1)).a` is not a constant

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-02-28T15:43:50Z
Last change time
2024-12-13T19:33:39Z
Assigned to
No Owner
Creator
ellapaul
Moved to GitHub: dmd#20412 →

Comments

Comment #0 by ellapaul392 — 2024-02-28T15:43:50Z
```d struct A { int i; } struct B { A a; } __gshared const B b = {a:{1}}; __gshared const A* aptr = &b.a; ``` Error: expression `&B(A(1)).a` is not a constant aptr is a const, and can be resolved at compile time.
Comment #1 by robert.schadek — 2024-12-13T19:33:39Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20412 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB