Bug 13720 – [REG2.067] Adding trivial destructor to std.datetime causes Internal error: ..\ztc\cgelem.c 2418

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-12T20:29:00Z
Last change time
2017-07-22T12:35:34Z
Keywords
ice, pull
Assigned to
nobody
Creator
bugzilla

Comments

Comment #0 by bugzilla — 2014-11-12T20:29:37Z
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
Comment #4 by k.hara.pg — 2015-06-15T09:58:26Z
Strip off dependencies to phobos/druntime. struct FracSec { this(int hnsecs) {} } struct SysTime { this(TimeOfDay dateTime, FracSec fracSec) { } } struct TimeOfDay { ~this() { } } void assertThrown(T)(lazy T) {} void main() { assertThrown(SysTime(TimeOfDay.init, FracSec(-1))); } With git-head: $ dmd -O test DMD v2.068 DEBUG Internal error: backend\cgelem.c 2412
Comment #5 by k.hara.pg — 2015-06-22T12:43:31Z
Comment #6 by github-bugzilla — 2015-06-23T06:01:03Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5a67cc2c12b351a4649de5caeb5e6b30e109d611 fix Issue 13720 - Adding trivial destructor to std.datetime causes Internal error: ..\ztc\cgelem.c 2418 https://github.com/D-Programming-Language/dmd/commit/d66bf4d32448e9768abd22d56dcc54548dd3da3e Merge pull request #4759 from 9rnsr/fix13720 [REG2.067] Issue 13720 - Adding trivial destructor to std.datetime causes Internal error: ..\ztc\cgelem.c 2418
Comment #7 by github-bugzilla — 2015-06-26T14:11:52Z
Commit pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/742f467c137c8dc6e42d0a4d0863d5bc63333b0f Merge pull request #4759 from 9rnsr/fix13720 [REG2.067] Issue 13720 - Adding trivial destructor to std.datetime causes Internal error: ..\ztc\cgelem.c 2418
Comment #8 by github-bugzilla — 2015-07-24T03:20:09Z
Comment #9 by github-bugzilla — 2015-10-04T18:18:35Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5a67cc2c12b351a4649de5caeb5e6b30e109d611 fix Issue 13720 - Adding trivial destructor to std.datetime causes Internal error: ..\ztc\cgelem.c 2418 https://github.com/D-Programming-Language/dmd/commit/d66bf4d32448e9768abd22d56dcc54548dd3da3e Merge pull request #4759 from 9rnsr/fix13720
Comment #10 by github-bugzilla — 2017-07-22T12:35:34Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/5a67cc2c12b351a4649de5caeb5e6b30e109d611 fix Issue 13720 - Adding trivial destructor to std.datetime causes Internal error: ..\ztc\cgelem.c 2418 https://github.com/dlang/dmd/commit/d66bf4d32448e9768abd22d56dcc54548dd3da3e Merge pull request #4759 from 9rnsr/fix13720