[Issue 852] New: ICE in dmd with anon. delegate in static class ctor in unittest

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 17 00:32:33 PST 2007


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

           Summary: ICE in dmd with anon. delegate in static class ctor in
                    unittest
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: daniel.keep+d.puremagic.com at gmail.com


Description:

If you attempt to compile code where there is a static constructor which
creates an anonymous delegate which instantiates the class itself, all of which
is in a unit test, with the "-unittest" switch, DMD crashes with an ICE.

Steps to reproduce:

1) Attempt to compile code below with the command "dmd -unittest ice.d".

Actual result:

The following message: "Internal error: toir.c 170"

Expected result:

Either a normal compilation error, or compilation success.

Compiler: Digital Mars D Compiler v1.0, WinXP SP2.

Code to reproduce: (ice.d)

unittest
{
    class Foo
    {
        static this()
        {
            auto i = {return new Foo;};
        }

        this() {}
    }
}

void main() {}


-- 



More information about the Digitalmars-d-bugs mailing list