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

          Issue ID: 15878
           Summary: Discarding return value prevents inlining
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

When a function has return value, discarding the value prevents inlining.

pragma(inline, true)
int foo() { return 0; }

void main()
{
    //int r = foo();    // OK
    foo();  // Error: function test.foo cannot inline function
}

--

Reply via email to