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

          Issue ID: 18746
           Summary: function returning empty struct isn't called if used
                    in equality expression
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: ag0ae...@gmail.com

Code is very similar to issue 12486, but apparently it's a different bug.

----
struct S {}

S f(ref int i)
{
    ++i;
    return S();
}

void main()
{
    int i = 2;
    assert(f(i) == S());
    assert(i == 3); /* fails, i = 2; should pass */
}
----

--

Reply via email to