D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20420 - [REG2.067] inlining error with a valid function
Summary: [REG2.067] inlining error with a valid function
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-11-27 04:11 UTC by Suleyman Sahmi (سليمان السهمي)
Modified: 2019-11-29 03:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Suleyman Sahmi (سليمان السهمي) 2019-11-27 04:11:43 UTC
Test case:
```
struct S { ~this(); }

class C
{
    this(S, int) {}
}

int i();

C create()
{
    return new C(S(), i());
}

auto test()
{
    auto c = create();
}
```

When compiled with `-inline` it fails, otherwise it works normally.
Comment 1 Dlang Bot 2019-11-28 14:58:59 UTC
@SSoulaimane created dlang/dmd pull request #10627 "Fix issue 20420 - some expressions are missed during by the inliner" fixing this issue:

- Fix issue 20420 - some expressions are missed during by the inliner
  
  The destructor expression for variable declaration is not scanned, as well as the arguments prefix for the new expression.

https://github.com/dlang/dmd/pull/10627
Comment 2 Dlang Bot 2019-11-29 03:13:18 UTC
dlang/dmd pull request #10627 "Fix issue 20420 - some expressions are missed during by the inliner" was merged into stable:

- c9e5c495cba0c629193b8417215b0d3622a82ef3 by سليمان السهمي  (Suleyman Sahmi):
  Fix issue 20420 - some expressions are missed during by the inliner
  
  The destructor expression for variable declaration is not scanned, as well as the arguments prefix for the new expression.

https://github.com/dlang/dmd/pull/10627