[Issue 2380] New: static struct initializer accepted as non static initializer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 30 04:43:01 PDT 2008


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

           Summary: static struct initializer accepted as non static
                    initializer
           Product: D
           Version: 1.034
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: tomas at famolsen.dk


D has different syntax for static struct initializers and struct literals.
several threads on the NG has been about this and there are enhancement
requests on this tracker as well...

dmd currently accepts the invalid code:

module structinitbug;
struct S {
        void* ptr;
}
void main() {
        S s = {null};
}

it seems that there are several issues surrounding initializers lately...

I found this due to it actually being used in Tango (xml.Document) and LLVMDC
not handling it properly.


-- 



More information about the Digitalmars-d-bugs mailing list