dmd/compiler/test/runnable/test20401.d
2022-07-09 18:53:07 +02:00

20 lines
255 B
D

// https://issues.dlang.org/show_bug.cgi?id=20401
void main()
{
int i;
assert(&passthrough(i) == &i);
}
ref int passthrough(return ref int i)
{
return get().flag ? i : i;
}
S get() { return S(); }
struct S
{
bool flag;
~this(){}
}