Bug 4784 – ICE(toir.c) with count()

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-01T10:27:00Z
Last change time
2010-11-22T02:12:16Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-09-01T10:27:12Z
import std.algorithm: count; import std.range: iota; void main() { int[] foo(R)(R m) { count!((a){ return true; })(m); return []; } foo(foo(iota(1))); } DMD 2.048 returns: Internal error: toir.c 190
Comment #1 by osa8aso — 2010-09-23T09:53:16Z
I got the same ICE (dmd 2.048 on linux) and was able to reduce the problem to a small test case which does not involve any libraries like std.algorithm: struct A( alias P ) { static void a() { void aa() { P(); } } } template B( alias P ) { void b() { A!P a; } } struct C( alias P ) { void c() { B!P.b(); } } void main() { void bar() {} C!bar c; } Compiling this produces the same error: Internal error: toir.c 190
Comment #2 by clugdbug — 2010-11-22T02:12:16Z
*** This issue has been marked as a duplicate of issue 4504 ***