[Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 7 15:05:32 PDT 2007


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





------- Comment #5 from nick.atamas at gmail.com  2007-07-07 17:05 -------
This also hangs the compiler with 100% CPU usage.
Not sure if this is the same issue or a different one, but it certainly looks
similar. Should it be added to DStress?

Note the comments sample - moving the declaration up or removing static from
declaration of makeS() fixes the hang issue.

class Klass
{
    protected S _s;

    public void one()
    {
        makesS();
    }

    //Move this up to fix hang
    struct S{int a;}

    //Making this non-static fixes hang
    protected static S makesS()
    {
        S s;
        return s;
    }
}

int main(){return 0;}


-- 



More information about the Digitalmars-d-bugs mailing list