www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14496] New: void initialization of member with indirections


          Issue ID: 14496
           Summary: void initialization of member with indirections must
                    not be  safe
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: schuetzm gmx.net

This should not compile:

struct Foo {
    int* indirection1;
    Object indirection2;
    string[] indirection3;

struct Bar {
    Foo foo = void; 

struct Baz {
    int* x = void;

 safe void main() {
    Bar bar;
    Baz baz;

Found by Justin Whear:

Apr 24 2015