www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10883] New: [ICE] Internal error: ../ztc/cod4.c 358 when compiling with -inline

http://d.puremagic.com/issues/show_bug.cgi?id=10883

           Summary: [ICE] Internal error: ../ztc/cod4.c 358 when compiling
                    with -inline
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: doob me.com



I get "Internal error: ../ztc/cod4.c" when compiling the following code with
-inline on Mac OS X:

U getValueOfField (T, U, string field) (T t)
{
    foreach (i, dummy ; typeof(T.tupleof))
        return t.tupleof[i];

    assert(0, "Should not happen");
}

class Foo
{
    auto bar = "foo";
}

void main ()
{
    auto a = getValueOfField!(Foo, string, "bar")(new Foo);
}

If I do any of the following the error disappears:

* Remove the assignment to "a"
* Remove the foreach loop
* Add a return statement after the assert
* Compile without -inline

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 24 2013