[Issue 16621] New: DMD hang in semantic3 on alias this or segfault

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Oct 18 04:54:23 PDT 2016


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

          Issue ID: 16621
           Summary: DMD hang in semantic3 on alias this or segfault
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: kozzi11 at gmail.com

some other info in forum 
http://forum.dlang.org/post/puufqwobmzseoucnbqts@forum.dlang.org

hang code example:

auto xxx(T)()
if (is(T == struct))
{
     return this;
}

struct Vector2f
{
    mixin xxx!(typeof(this));
    alias xxx this;
}

void foo(ref const Vector2f pos) {}

void main()
{
    Vector2f v;
    foo(v);
}

segfault example:

import std.stdio;

auto xxx(T)()
{
     return this;
}

struct S
{
    mixin xxx!(typeof(this));
    alias xxx this;
}

void foo(S pos)
{
    writeln(pos);
}

void main(){}

--


More information about the Digitalmars-d-bugs mailing list