Adding:
public pure nothrow @safe @nogc ~this() { }
to struct TimeOfDay in std\datetime.d, and then compiling with:
dmd std\datetime -unittest -main -O
produces:
Internal error: ..\ztc\cgelem.c 2418
This is a blocker for:
https://github.com/D-Programming-Language/dmd/pull/4136
and for using destructors in general.
Comment #1 by mxfomin — 2015-06-13T21:43:40Z
Reduced
module std.datetime;
import core.time;
import std.exception;
alias DateTimeException = TimeException;
struct SysTime
{
this(in DateTime dateTime, in FracSec fracSec, immutable UTC tz = null) { }
/+deprecated+/ unittest
{
assertThrown!DateTimeException(SysTime(DateTime.init, FracSec.from!"hnsecs"(-1), UTC()));
}
}
struct TimeOfDay
{
public pure nothrow @safe @nogc ~this() { }
ubyte _hour;
ubyte _minute;
ubyte _second;
}
struct DateTime
{
TimeOfDay _tod;
}
class UTC
{
static immutable(UTC) opCall() @safe pure nothrow
{
return _utc;
}
static immutable UTC _utc = new immutable(UTC)();
}
Comment #2 by mxfomin — 2015-06-13T21:50:49Z
module std.datetime;
import core.time;
import std.exception;
struct SysTime
{
this(in TimeOfDay dateTime, in FracSec fracSec) { }
/+deprecated+/ unittest
{
assertThrown!Exception(SysTime(TimeOfDay.init, FracSec.from!"hnsecs"(-1)));
}
}
struct TimeOfDay
{
public pure nothrow @safe @nogc ~this() { }
ubyte _hour;
ubyte _minute;
ubyte _second;
}
FracSec seems to be important.
Comment #3 by dlang-bugzilla — 2015-06-13T21:54:07Z