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

--- Comment #0 from Cristi Cobzarenco <> 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

    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:
------- You are receiving this mail because: -------

Reply via email to