1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail9537.d(26): Error: foo(tuple(1, 2)) is not an lvalue
5 ---
6 */
7 
Tuple(T...)8 struct Tuple(T...)
9 {
10     T field;
11     alias field this;
12 }
13 
14 Tuple!T tuple(T...)(T args)
15 {
16     return Tuple!T(args);
17 }
18 
foo(T)19 auto ref foo(T)(auto ref T t)
20 {
21     return t[0];    // t[0] is deduced to non-ref
22 }
23 
main()24 void main()
25 {
26     int* p = &foo(tuple(1, 2));
27 }
28