Bug 16188 – [REG2.069] ICE on invalid code

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-21T02:44:00Z
Last change time
2016-08-01T19:54:33Z
Keywords
ice-on-invalid-code
Assigned to
nobody
Creator
changlon

Comments

Comment #0 by changlon — 2016-06-21T02:44:58Z
ICE for DMD 2.071: //============================================================================== class DB { } //============================================================================== Query where(alias pred, Query)(Query ) { auto p = Where!(); pred(p); // record predicate } struct Where() { auto opDispatch(string name)() { alias FieldType = typeof(getMember); WhereField!FieldType; } } struct WhereField(FieldType) { }void main() { auto db = DB; db.where!(p => p.name ); } ============================= ..\test.d(30): Error: type DB has no value ..\test.d(11): Error: type Where!() has no value object.Error@(0): Access Violation ---------------- 0x004EC058
Comment #1 by ag0aep6g — 2016-06-21T18:27:38Z
Reduced further: ---- void where() { Where().name; } struct Where { void opDispatch(string name)() { alias FieldType = typeof(getMember); WhereField!FieldType; } } struct WhereField(FieldType) {} ---- Doesn't segfault with 2.068.2 and earlier.
Comment #2 by bugzilla — 2016-07-09T10:07:17Z
Comment #3 by github-bugzilla — 2016-07-09T21:39:32Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8fbedf504bed737241f734f7c8883693ba069472 fix Issue 16188 - [REG2.069] ICE on invalid code https://github.com/dlang/dmd/commit/920e870e848e7668a15219cb004e422e25448d3e removed change in declaration.d unrelated to Issue 16188 - I assume it was an attempt at showing the correct error message during opDispatch semantics (by rerunning semantic). But as we still get the wrong error message and this change isn't necessary to fix 16188, we better not merge it into stable. https://github.com/dlang/dmd/commit/b3c0283c4b2acbc24919c9dfdb0f68a7ba1f2bfb Merge pull request #5927 from MartinNowak/fix16188 fix Issue 16188 - [REG2.069] ICE on invalid code
Comment #4 by ag0aep6g — 2016-07-13T20:30:07Z
*** Issue 16276 has been marked as a duplicate of this issue. ***
Comment #5 by github-bugzilla — 2016-08-01T19:54:33Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8fbedf504bed737241f734f7c8883693ba069472 fix Issue 16188 - [REG2.069] ICE on invalid code https://github.com/dlang/dmd/commit/920e870e848e7668a15219cb004e422e25448d3e removed change in declaration.d unrelated to Issue 16188 https://github.com/dlang/dmd/commit/b3c0283c4b2acbc24919c9dfdb0f68a7ba1f2bfb Merge pull request #5927 from MartinNowak/fix16188