www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20969] New: alias to local in static

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

          Issue ID: 20969
           Summary: alias to local in static
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

void main()
{
    int a;
    static s = S!a();
    s.bar();
}

struct S(alias q)
{
    int b;
    void bar()
    {
        b = q;
    }
}

segfault reading q, it attempts to read address 0x8

same in all versions of dmd seen on run.dlang.io

--
Jun 22 2020