Bug 18119 – Allow code that may allocated inside __ctfe condition branches in @nogc functions

Status
ASSIGNED
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-12-24T16:46:13Z
Last change time
2024-12-13T18:55:45Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dmd#19354 →

Comments

Comment #0 by ibuclaw — 2017-12-24T16:46:13Z
Original suggestion from here: https://github.com/dlang/dmd/pull/3572
Comment #1 by ibuclaw — 2017-12-24T16:49:25Z
The suggestion was to make the following condition statements as specializations. if (__ctfe) { } if (!__ctfe) { } Then, anything in the __ctfe branch that can be evaluated at compile time but would otherwise cause a GC allocation at runtime would be permissible in @nogc functions.
Comment #2 by dlang-bot — 2022-03-25T16:47:58Z
@ibuclaw updated dlang/dmd pull request #7509 "Fix Issue 18119 - Mark if(__ctfe) blocks as SCOPEctfe" fixing this issue: - Fix Issue 18119 - Mark if(__ctfe) blocks as SCOPEctfe https://github.com/dlang/dmd/pull/7509
Comment #3 by robert.schadek — 2024-12-13T18:55:45Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19354 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB