]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/diag4596.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag4596.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag4596.d(15): Error: `this` is not an lvalue and cannot be modified
5 fail_compilation/diag4596.d(16): Error: conditional expression `1 ? this : this` is not a modifiable lvalue
6 fail_compilation/diag4596.d(18): Error: `super` is not an lvalue and cannot be modified
7 fail_compilation/diag4596.d(19): Error: conditional expression `1 ? super : super` is not a modifiable lvalue
8 ---
9 */
10
11 class NoGo4596
12 {
13 void fun()
14 {
15 this = new NoGo4596;
16 (1?this:this) = new NoGo4596;
17
18 super = new Object;
19 (1?super:super) = new Object;
20 }
21 }