[Issue 16360] New: DMD fails to inline functions that contain a type
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sun Aug  7 09:00:22 PDT 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=16360
          Issue ID: 16360
           Summary: DMD fails to inline functions that contain a type
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com
When a simple type is nested in the function, e.g as an helper DMD fails to
inline:
°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#!runnable-flags: -O -inline
module runnable;
import std.stdio;
pragma(inline, true)
auto foo(int t)
{
    struct Bar{}
    return t;
}
void main()
{
    auto v = foo(1);
}
°°°°°°°°°°°°°°°°°°°°°°°°°°°°
outputs:
> /tmp/temp_7FD0A006D9F0.d(7,6): Error: function runnable.foo cannot inline function
--
    
    
More information about the Digitalmars-d-bugs
mailing list