Bug 4964 – ICE(mtype.c) casting to undefined types
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-10-01T00:27:00Z
Last change time
2015-06-09T05:14:37Z
Keywords
ice-on-invalid-code
Assigned to
nobody
Creator
spam
Comments
Comment #0 by spam — 2010-10-01T00:27:41Z
int main(string[] argv)
{
auto crash = cast(Foo*)&_addr;
return 0;
}
yes both Foo and _addr are undefined and dmd issues errors for that but then it sill crashes with an assert:
main.d(22): Error: identifier 'Foo' is not defined
main.d(22): Error: Foo is used as a type
Assertion failure: 'tn->mod & MODimmutable || tn->mod & MODconst' on line 875 in file 'mtype.c'
Tested on windows using dmd2.049
Comment #1 by bugzilla — 2010-11-07T12:30:01Z
*** This issue has been marked as a duplicate of issue 4434 ***