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

16 lines
231 B
D

// https://issues.dlang.org/show_bug.cgi?id=18746
struct S {}
S f(ref int i)
{
++i;
return S();
}
void main()
{
int i = 2;
assert(f(i) == S());
assert(i == 3); /* failed before patch, i = 2; should pass */
}