[Issue 6094] && doesn't shortcut properly with CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 21 02:21:37 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6094



--- Comment #12 from Don <clugdbug at yahoo.com.au> 2011-07-21 02:21:25 PDT ---
One last little bit of complexity about this issue. The code for
IfStatement::semantic() in statement.c contains this comment:

    // If we can short-circuit evaluate the if statement, don't do the
    // semantic analysis of the skipped code.
    // This feature allows a limited form of conditional compilation.

If this were actually true, it'd be a strong argument for changing the
behaviour of &&. But I suspect this comment is obsolete.
In version 0.116 and earlier, the code below used to compile:

void main()
{
    if (0) anyoldgarbage();
}

But starting with 0.117, it was rejected. My feeling is that the comment should
be removed from the source, and this bug closed as WONTFIX.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list