d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail177.d
blob49edf4da40ca872ee56efb47dd41e583f75b8593
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail177.d(22): Error: cannot modify `immutable` expression `j`
5 fail_compilation/fail177.d(24): Error: cannot modify `const` expression `i`
6 fail_compilation/fail177.d(26): Error: cannot modify `const` expression `s1.x`
7 fail_compilation/fail177.d(27): Error: cannot modify `const` expression `*s1.p`
8 fail_compilation/fail177.d(29): Error: cannot modify `const` expression `s2.x`
9 fail_compilation/fail177.d(30): Error: cannot modify `const` expression `*s2.p`
10 ---
13 struct S
15 int x;
16 int* p;
19 void test(const(S) s1, const S s2, const(int) i)
21 immutable int j = 3;
22 j = 4;
24 i = 4;
26 s1.x = 3;
27 *s1.p = 4;
29 s2.x = 3;
30 *s2.p = 4;