D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4964 - ICE(mtype.c) casting to undefined types
Summary: ICE(mtype.c) casting to undefined types
Status: RESOLVED DUPLICATE of issue 4434
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2010-10-01 00:27 UTC by Stephan Dilly
Modified: 2015-06-09 05:14 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Dilly 2010-10-01 00:27:41 UTC
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 Walter Bright 2010-11-07 12:30:01 UTC

*** This issue has been marked as a duplicate of issue 4434 ***