www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13835] New: ICE in interpret.c:736 - Issue with static

https://issues.dlang.org/show_bug.cgi?id=13835

          Issue ID: 13835
           Summary: ICE in interpret.c:736 - Issue with static variables.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: dev nomad.so

class Foo(T)
{
    private T* _data;

    final private void siftUp(int position) nothrow
    {
        static T crash = *(this._data + position);
    }
}

void main(string[] args)
{
    auto heap = new Foo!(int);
}

Compiler output:

rdmd --force -de -debug -w test.d
dmd: interpret.c:736: Expression* ctfeInterpret(Expression*): Assertion
`global.errors != olderrors' failed.
Failed: ["dmd", "-de", "-debug", "-w", "-v", "-o-", "test.d", "-I."]

Remove the static keyword and it compiles fine.

--
Dec 08 2014