https://issues.dlang.org/show_bug.cgi?id=17457
Issue ID: 17457
Summary: Named Return Value Optimization (NRVO) not done with
return of constructor call
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
NRVO is not done for:
struct S {
ulong[10] x; // ensure stack placement instead of register placement
this(int i);
}
S foo() {
return S(10);
}
but is done for:
S foo() {
auto s = S(10);
return s;
}
--