[Issue 5090] New: Assertion `sz <= vsz' failed with struct literal initializing zero length array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 20 16:15:26 PDT 2010


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

           Summary: Assertion `sz <= vsz' failed with struct literal
                    initializing zero length array
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ibuclaw at ubuntu.com


--- Comment #0 from Iain Buclaw <ibuclaw at ubuntu.com> 2010-10-20 16:14:46 PDT ---
Test cases:

struct A { int[0] b; }
A a = A(0); // Fails, compiler aborts
A b = {b:0}; // OK, but perhaps shouldn't be.
A c = A([]); // OK
A d = {b:[]}; // OK



Although the compiler shouldn't issue an assert, a zero length array
should be enforced to have a 0 length initializer.

Regards

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


More information about the Digitalmars-d-bugs mailing list