www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12827] New: DMD segfaults if the member variable has the same

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

          Issue ID: 12827
           Summary: DMD segfaults if the member variable has the same name
                    as the template argument
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: camille.brugel laposte.net

DMD segfaults if the member variable has the same name as the template argument

Example of code :

    struct Foo(int i)
    {
        immutable int i = i;
    }

    void main()
    {
        Foo!5 foo;
        writeln(foo);
    }

Output :

    app.d(20): Deprecation: variable app.Foo!5.Foo.i immutable field with
initializer should be static, __gshared, or an enum
    Segmentation fault (core dumped)

--
May 31 2014