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

--- Comment #0 from Kenji Hara <> 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:
------- You are receiving this mail because: -------

Reply via email to