www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20420] New: [REG2.067] inlining error with a valid function

https://issues.dlang.org/show_bug.cgi?id=20420

          Issue ID: 20420
           Summary: [REG2.067] inlining error with a valid function
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: sahmi.soulaimane gmail.com

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.

--
Nov 26 2019