www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12438] New: Wrong code for result of assignment to `ref`/`out` struct parameter

https://d.puremagic.com/issues/show_bug.cgi?id=12438

           Summary: Wrong code for result of assignment to `ref`/`out`
                    struct parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2014-03-22
12:30:40 MSK ---
This code should run fine:
---
struct S { int i; }

void f(ref S s1)
{
    assert((s1 = S()) == S()); // fails
}

void main()
{
    S s1;
    f(s1);
}
---

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 22 2014