[Issue 6200] New: [GSoC] Value returned by function cannot be passed as ref const.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 23 12:28:16 PDT 2011


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

           Summary: [GSoC] Value returned by function cannot be passed as
                    ref const.
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: cristi.cobzarenco at gmail.com


--- Comment #0 from Cristi Cobzarenco <cristi.cobzarenco at gmail.com> 2011-06-23 12:23:27 PDT ---
struct Test {}

void takes( ref const Test x ) {}

Test gives() { return Test(); }

int main() {
    takes( Test() );     // compiles
    // takes( gives() ); // doesn't compile
    readln();

    return 0;
}

Is this required behaviour? The compiler complains about gives() not being an
lvalue, but the code doesn't seem to require it to be an lvalue.

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


More information about the Digitalmars-d-bugs mailing list