cat > bug.d << CODE
class E : Exception
{
this(string msg)
{
super(msg);
}
}
bool foo()
{
throw new E("message");
}
static assert(foo());
CODE
dmd -c bug
----
bug.d(5): Error: uncaught CTFE exception bug.E("message")
bug.d(11): thrown from here
bug.d(14): called from here: foo()
bug.d(14): while evaluating: static assert(foo())
----
The first line shouldn't be present in the stacktrace, b/c that's code constructing the exception, which happens before the exception is thrown.