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); }
Comment #2 by bugzilla — 2013-04-16T23:03:06Z
Comment #3 by github-bugzilla — 2013-04-17T22:32:40Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/baa93d923a8386dc8d3d3db43dd17c4115ef8b29 fix Issue 9209 - ice(symbol.c) with const struct heap allocation https://github.com/D-Programming-Language/dmd/commit/202a28b20900a97d5a13ccbfb5a0be3cf9f28507 Merge pull request #1904 from WalterBright/fix9209 fix Issue 9209 - ice(symbol.c) with const struct heap allocation