Bug 8939 – ICE(glue.c) on passing by ref statically initialized const/immutable variable
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-02T07:56:00Z
Last change time
2012-11-17T16:24:06Z
Keywords
ice, pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2012-11-02T07:56:39Z
---
void f(T)(ref T) { } // same for `auto ref`
const n = 1; // or `immutable`
void main()
{
f(n); // main.d(8): Error: constant 1 is not an lvalue
// And ICE: Assertion failure: '0' on line 1224 in file 'glue.c'
}
---
The bad thing is that it breaks `auto ref` too with same (incorrect now) "not an lvalue" error before ICE.
Comment #1 by verylonglogin.reg — 2012-11-02T08:23:10Z
May be connected with
Issue 8940 - Able to modify const/immutable with passing to a templated function by `ref`