D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15690 - [ICE] backend/symbol.c 1032
Summary: [ICE] backend/symbol.c 1032
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 critical
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2016-02-16 11:03 UTC by ponce
Modified: 2020-03-21 03:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ponce 2016-02-16 11:03:16 UTC
DMD 2.070 crash with the evil following construct:


-----------------

import std.stdio;
import std.typecons;
import std.range;

void main() {
	
	int id = 0;
	switch (id) {
			
	 
		static immutable myArray = iota(100).array;
		
     	foreach(i; myArray) 
		{
			case i:
				writefln("i: %d", i);
				break;
		}
		
		default: ;
		
	}
	
}


-----------------

http://dpaste.dzfl.pl/4acbf36da8a4
Comment 1 basile-z 2017-01-15 23:05:58 UTC
This case is deprecated now, should this issue be closed then ?
Comment 2 hsteoh 2018-06-12 22:57:06 UTC
Tested on latest git master (153db26c226d84a27a926810025b91eb6583849c), confirmed that this no longer crashes the compiler.

Compiler output:
------
test.d(20): Deprecation: use { } for an empty statement, not ;
test.d(15): Error: case variable i declared at test.d(13) cannot be declared in switch body
------