The following (incorrect) code causes DMD to segfault on compilation: template Foo(T) if (is(T == int)) { enum bool Foo = true; } template Foo(T) if (!is(T == int)) { enum bool Foo = Foo(typeof(int.min)); } static assert (Foo!double); In the second template, note the following two things which are BOTH required to reproduce the bug: 1) The ! is missing from the template instantiation. 2) The template parameter is typeof(int.min) instead of just int.
Fixed DMD2.043.