[Dlang-internal] Detect CTFE in AssignExp:semantic

Stefan Koch via Dlang-internal dlang-internal at puremagic.com
Wed Jan 11 07:25:13 PST 2017


On Wednesday, 11 January 2017 at 09:05:44 UTC, Lucia Cojocaru 
wrote:
> The dmd code (e2ir.d and expression.d are of interest):
> https://github.com/somzzz/dmd/commit/8bccc49ba661567c523545650aad30c01fd25090
>
> The druntime template:
> https://github.com/somzzz/druntime/commit/6cf9cbc6650697d8a038be7076e588601aefe954
>
> The example which doesn't compile is a standalone code snippet 
> which reproduces the error encountered. I started from the code 
> in druntime and simplified it to that point. As of your 
> suggestions, I will simplify it further and come back with 
> another example.
>
> Thanks!

You should not need to special case ctfe inside the compiler for 
this.
Rather the template should have if (__ctfe) inside it if those 
are needed.
However I would advise against splitting code-paths, if it is not 
_strictly_ necessary.

I will be able to provide more help should you need it.
Just contact me if you encounter further problems.


More information about the Dlang-internal mailing list