d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / nestedtempl1.d
blobc34d70b53e1f1b7a4a039e381efc5855204931c2
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/nestedtempl1.d(14): Deprecation: function `nestedtempl1.main.bar!(a).bar` function requires a dual-context, which is deprecated
5 fail_compilation/nestedtempl1.d(26): instantiated from here: `bar!(a)`
6 fail_compilation/nestedtempl1.d(26): Error: modify `inout` to `mutable` is not allowed inside `inout` function
7 ---
8 */
10 auto foo(ref inout(int) x)
12 struct S
14 ref inout(int) bar(alias a)() inout
16 return x;
19 return S();
22 void main()
24 int a;
25 auto o = foo(a);
26 o.bar!a() = 1; // bad!