[Issue 15878] New: Discarding return value prevents inlining

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Apr 5 06:04:46 PDT 2016


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: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com

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
}

--


More information about the Digitalmars-d-bugs mailing list