Bug 2308 – CTFE crash on foreach over nonexistent variable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2008-08-23T11:30:00Z
Last change time
2014-03-01T00:35:58Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2008-08-23T11:30:34Z
bool foo() { foreach (x; xs) {} return true; } static assert (foo()); Compiling the above gives the following, after which DMD crashes: asdff.d(2): Error: undefined identifier xs asdff.d(2): Error: cannot infer type for x
Comment #1 by matti.niemenmaa+dbugzilla — 2008-09-03T01:19:32Z
Fixed in DMD 1.035.
Comment #2 by bugzilla — 2008-09-03T01:37:06Z
Fixed dmd 1.035 and 2.019