[Issue 8939] New: ICE on passing by ref statically initialized const/immutable variable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 2 07:56:40 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8939

           Summary: ICE on passing by ref statically initialized
                    const/immutable variable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2012-11-02 17:56:39 MSK ---
---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list