[Issue 21911] New: dmd compiler segfault with std.container array, templated struct, and static if

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 10 18:20:31 UTC 2021


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

          Issue ID: 21911
           Summary: dmd compiler segfault with std.container array,
                    templated struct, and static if
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ofsfmq+2y1kh9wla11eg at grr.la

DMD32 D Compiler v2.096.0-dirty (Windows 10 x64)
Compiler crashes with "Segmentation fault" with the following code.

import std.container.array;
struct Foo(T) {
        struct Bar {
                T value;
        }
        Array!Bar bar;
        this(string str) {
                static if (is(T == string)) {} // also fails with enum, float,
etc
        }
}
void main() {
        Foo!int f;
}

--


More information about the Digitalmars-d-bugs mailing list