[Issue 490] New: Static struct initializer without static attribute aborts dmd with assertion

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 8 17:17:03 PST 2006


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

           Summary: Static struct initializer without static attribute
                    aborts dmd with assertion
           Product: D
           Version: 0.173
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: chievo3 at gmail.com


public struct S 
{
        int a, b;
}

void main() {
        S s= {1, 2}; // DMD fails to throw an error and aborts.
        S q= {a:1, b:2}; // Idem.

        static S r= {1, 2}; // OK.
        static S t= {a:1, b:2}; // OK.
}

DMD says:
dmd: init.c:219: virtual Expression* StructInitializer::toExpression():
Assertion `0' failed.
Aborted


-- 




More information about the Digitalmars-d-bugs mailing list