www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21164] New: segfault on incomplete static if

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

          Issue ID: 21164
           Summary: segfault on incomplete static if
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: uplink.coder gmail.com

Given the following files :

--- main.d:
import a;
import b;
auto GB(D!Q)
{
}

--- a.d
struct D(E)
{
        void G()        {
                import d;
I;
        }

}

--- b.d
import c;
enum N = O();
alias Q = R!(N, S);

--- c.d
enum S = 1;

struct O
{
}

struct R(O U, int W ) // extend to KPDateTime later
{
}

--- d.d
auto AB()
{
static if}

auto I()
{
AB;
}

dmd will segfault while trying to evaluate the static if condition.

--
Aug 15 2020