Bug 9209 – ice(symbol.c) with const struct heap allocation
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-26T03:13:00Z
Last change time
2013-04-17T22:32:56Z
Keywords
ice, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2012-12-26T03:13:25Z
struct Foo(T) { T x; }
void bar(T)(in Foo!T*) {}
void main () {
const f = new Foo!int(1);
bar(f);
}
DMD 2.061alpha gives:
Internal error: backend\symbol.c 1025
This is not exactly a regression because this syntax was not allowed in DMD 2.060, but it's a bug not present in DMD 2.060.
Comment #1 by yebblies — 2013-01-14T03:18:20Z
Does not need templates:
struct Foo { int x; }
void bar(const Foo*) {}
void main () {
const f = new Foo(1);
bar(f);
}