www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7100] New: rvalue binds to ref argument

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7100

           Summary: rvalue binds to ref argument
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrei metalanguage.com



15:42:36 PST ---
I am sure this bug has been filed, but it doesn't have the right keywords so I
couldn't find it. If anyone does, please make that a dupe of this.

struct abc
{
   ref abc opAssign(ref abc rhs)
   {
       writeln("opAssign");
       return this;
   }
}

void
main(string[] argv)
{
   abc x;
   x= abc();
}

The code shouldn't compile. I fished this one from a lost email from June 6,
2010.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7100


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



Current dmd implementation marks struct literal and construction as lvalue.

*** This issue has been marked as a duplicate of issue 5889 ***

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