]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail176.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail176.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail176.d(13): Error: cannot modify immutable expression a[1]
5 fail_compilation/fail176.d(16): Error: cannot modify immutable expression b[1]
6 fail_compilation/fail176.d(19): Error: cannot modify const expression c[1]
7 ---
8 */
9
10 void foo()
11 {
12 auto a = "abc";
13 a[1] = 'd';
14
15 immutable char[3] b = "abc";
16 b[1] = 'd';
17
18 const char[3] c = "abc";
19 c[1] = 'd';
20 }