[Issue 23165] New: lambda functions are not inlined
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 7 00:49:43 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23165
Issue ID: 23165
Summary: lambda functions are not inlined
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
The following should inline the lambda when compiled with -inline, but does
not:
int test(string type)
{
auto number = 200;
return type == "as-is"?
number:
{ number *= 2;
number += 2;
number /= 2;
number = number > 300 ? 200 : 100;
return number;
}(); // should be inlined
return number;
}
--
More information about the Digitalmars-d-bugs
mailing list