[Issue 13977] New: Front-end optimizer bug in AndAndExp
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Jan 13 05:54:43 PST 2015
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: nobody at puremagic.com
Reporter: k.hara.pg at gmail.com
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?
}
--
More information about the Digitalmars-d-bugs
mailing list