Original suggestion from here: https://github.com/dlang/dmd/pull/3572
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.
@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