https://issues.dlang.org/show_bug.cgi?id=19268
--- Comment #6 from Adam D. Ruppe <[email protected]> --- I think my proposal would be that *specifically* the `if(__ctfe)` construct overrides the betterC checks, since that can be easily factored out. Just like how we can write --- int* do_something() { if(__ctfe) { return new int; } else { return cast(int*) malloc(int.sizeof); } } enum e = *do_something(); --- today (which works in real D, including without linking druntime btw), which bypasses the normal "malloc cannot be evaluated at compile time), we could conceivably use it in the other direction to allow something in a CT context that isn't allowed in a RT context. I'm not sure how to write that in spec language... it might be able to just say specifically that betterC's restrictions do not apply inside that specific ast node and like specifically hack the hack that is betterC. I think that would be fine with `__traits(compiles)` as well. The `if(__ctfe)` switch keeps everything compiling the same way - it is specifically a runtime branch in terms of formal semantics. So the compiles thing passes because that if branch is encapsulated still. --
