Bug 24489 – [REG 2.106] GC array allocations during CTFE in -betterC mode is unnecessarily restricted now

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-04-08T22:45:29Z
Last change time
2024-12-13T19:34:31Z
Assigned to
No Owner
Creator
TheGag96
Moved to GitHub: dmd#20437 →

Comments

Comment #0 by kipthemudkip — 2024-04-08T22:45:29Z
Prior to LDC 1.36.0 (DMD 2.106.1), the following code would compile just fine with -betterC switched on: static immutable thing = () { int[] result = new int[](3); return result; }(); Now in LDC 1.37.0 (DMD 2.107.1), I get: Error: expression `new int[](3LU)` allocates with the GC and cannot be used with switch `-betterC` I have a feeling the issue is commit 0eb4ea8c48af9c439928b7470b5ecd6c55e3793d from pull request #15982, the fix for issue 24295. Thanks!
Comment #1 by robert.schadek — 2024-12-13T19:34:31Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20437 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB