www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4162] New: pass by alias offset problems

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

           Summary: pass by alias offset problems
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k-foley onu.edu



DMD 2.045
---
import std.stdio;

struct B(alias _)
{
    void print() { writeln(&_); }
}

struct C(alias _)
{
    int i;
    void print() { writeln(&_); }
}

int main(string[] args)
{
    int a;

    auto b = B!(a)();
    writeln(&a);
    b.print();

    auto c = C!(a)();
    writeln(&a);
    c.print();

    return 0;
}

---
$ rdmd passByAlias.d
B75B5E54
B75B5E54
B75B5E54
804E358
end
zsh: segmentation fault  rdmd passByAlias.d
---

It seems that C having a field messes with what DMD thinks the _ alias refers
to.

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