www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13978] New: Front-end optimizer bug in OrOrExp

https://issues.dlang.org/show_bug.cgi?id=13978

          Issue ID: 13978
           Summary: Front-end optimizer bug in OrOrExp
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

Boolean-condition || void-expression should be a valid D expression, but the
following code fails to compile.

----
bool cond(bool b) { return b; }

void main()
{
    cond(true) || assert(0);
    cond(false) || assert(0);

    true || assert(0);  // Error: integral constant must be scalar type, not
void
    false || assert(0);
}

--
Jan 13 2015