www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17152] New: DMD segfaults because of struct with static const

https://issues.dlang.org/show_bug.cgi?id=17152

          Issue ID: 17152
           Summary: DMD segfaults because of struct with static const
                    struct members
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: meapineapple gmail.com

DMD 2.072.0 crashes when compiling this program:

    struct Test{
        static const A = Test([1, 2, 3]);
        static const B = Test([4, 5, 6]);
        int[] x;
    }
    void main(){}

 dmd test.d
Segmentation fault: 11 Changing from const to immutable does not affect the error. It works fine if one of the static const members are removed. It works fine if the members are static enum instead of static const. --
Feb 07