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.
Comment #1 by k.hara.pg — 2013-11-18T05:53:25Z
Fixed in 2.050.
Comment #2 by github-bugzilla — 2013-11-18T08:41:58Z