MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail9537.d
blobe08badf34a91edca8e132eff787f523402586211
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail9537.d(26): Error: `foo(tuple(1, 2))` is not an lvalue and cannot be modified
5 ---
6 */
8 struct Tuple(T...)
10 T field;
11 alias field this;
14 Tuple!T tuple(T...)(T args)
16 return Tuple!T(args);
19 auto ref foo(T)(auto ref T t)
21 return t[0]; // t[0] is deduced to non-ref
24 void main()
26 int* p = &foo(tuple(1, 2));