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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Cristi Cobzarenco <[email protected]> 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: -------