[Issue 4322] New: "void initializer has no value" on struct/union members initialized to "void"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 15 10:37:47 PDT 2010


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

           Summary: "void initializer has no value" on struct/union
                    members initialized to "void"
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: graham.fawcett at gmail.com


--- Comment #0 from Graham Fawcett <graham.fawcett at gmail.com> 2010-06-15 10:37:45 PDT ---
The following code fails to compile:

struct Foo {
    int[1] a = void;
}
void main() {
    Foo f = Foo();
}

$ dmd err.d
err.d(2): Error: void initializer has no value

Removing the "= void" initializer resolves the issue.
The error is not related to the size of the array, or the element type.

Note that phobos/std/variant.d, line 192, has such a declaration, 
which causes some variant-using application code to fail with the same
error message.

-- 
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