https://issues.dlang.org/show_bug.cgi?id=14421
Issue ID: 14421
Summary: Variadic args array force on heap
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
char[] foo(char[] args ...)
{
return args;
}
This is obviously wrong code, as args can be allocated on the stack. However,
it might not be.
Currently the only way out is to go `return args.dup` but that can lead to
allocating twice.
--