www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14267] New: [REG2.067 beta] ICE when determining if a


          Issue ID: 14267
           Summary: [REG2.067 beta] ICE when determining if a function can
                    be inlined
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice, ice-on-valid-code
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: opantm2+dbugs gmail.com

Requires -inline to be passed in as the ICE occurs when detecting if inlining
is possible. I'm not sure why that __traits(getProtection, func) is required,
but it seems to be. I used '-O -inline -release' to trigger the ICE.

import std.datetime;

void main() {
    foreach(m; __traits(allMembers, SysTime)) {
        static if(is(typeof(__traits(getMember, SysTime, m)))) {
            foreach(func; __traits(getOverloads, SysTime, m)) {
                auto prot = __traits(getProtection, func);
                static if(__traits(isStaticFunction, func))
                    auto result = func;

rdmd -O -inline -release temp.d
Assertion failed: (fd->semanticRun >= PASSsemantic3done), function canInline,
file inline.c, line 1646.

Mar 09 2015