On 10/08/2014 10:01 PM, Andrei Alexandrescu wrote:

That's a bummer. Can we get the compiler to remove the "if (__ctfe)"
code after semantic checking?

Andrei

It seems that __ctfe is treated as constant in the backend.
At least there is no asm code generated for these examples (even without -O).

    void main()
    {
        import std.stdio;
        if (__ctfe)
            writeln("foo");
    }

    int main() { return __ctfe ? 1 : 0; }

Reply via email to