http://d.puremagic.com/issues/show_bug.cgi?id=5178

           Summary: StructLiteral should not be lvalue
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2010-11-06 03:49:16 PDT ---
Created an attachment (id=802)
Patch for DMD svn r737

This code generates wrong code.

struct S{}
void swap(ref S a, ref S b){}
ref S get(){return S();}  //should be rejected
void main(){
    swap(get(), get());
}

In function swap, a and b access invalid local stack address.
I think StructLiteral should not be lvalue, but current dmd allows it.

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

Reply via email to