[Issue 18581] New: Segmentation fault with dmd -X if static foreach inside template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 8 20:37:33 UTC 2018


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

          Issue ID: 18581
           Summary: Segmentation fault with dmd -X if static foreach
                    inside template
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ali.akhtarzada at gmail.com

The following seg faults:

template A(T) {
  static foreach(I; 0 .. 1) { }
  alias A = T;
}

void main() {
  A!int a;
}

$ dmd -o- -X main.d

Comment out the static foreach and it won't segfault anymore.

Tried with dmd v2.079.0-beta.1 and dmd v2.078.3 locally, and on run.dlang.io
you get:

Since      2.076.1: Segfault and no output

https://run.dlang.io/is/SliEb2

--


More information about the Digitalmars-d-bugs mailing list