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: [email protected]
          Reporter: [email protected]

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);
}

--

Reply via email to