https://issues.dlang.org/show_bug.cgi?id=13977
Issue ID: 13977
Summary: Front-end optimizer bug in AndAndExp
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: wrong-code
Severity: major
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
Compiling with version=B and version=D should have consistent runtime behavior,
but doesn't.
bool cond(bool b) { return b; }
void main()
{
version(A) cond(true) && assert(0); // asserts in runtime, ok
version(B) cond(false) && assert(0); // no assert, ok
version(C) true && assert(0); // assert in runtime, ok
version(D) false && assert(0); // asserts in runtime, why?
}
--