auto ref T max(T)(auto ref T u, auto ref T v) => u > v ? u : v;
void main()
{
int a = 1;
int b = 0;
int x;
static assert(__traits(compiles, &max(a,b) == &a),
"should have selected the lvalue version");
static assert(__traits(compiles, x = max(1,0)),
"should have selected the rvalue version");
static assert(__traits(compiles, x = max(a,0)),
"should have selected the rvalue version");
static assert(__traits(compiles, x = max(1,0)),
"should have selected the rvalue version");
} #ifdef CONTRACTS
if (i >= array_length) panic("index out of bounds")
#endif