Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail13336b.d

raw
1 // REQUIRED_ARGS: -o-
2
3 int sx;
4 double sy;
5
6 /*
7 TEST_OUTPUT:
8 ---
9 fail_compilation/fail13336b.d(16): Error: cannot `ref` return expression `cast(double)sx` because it is not an lvalue
10 fail_compilation/fail13336b.d(24): Error: cannot `ref` return expression `cast(double)sx` because it is not an lvalue
11 ---
12 */
13 ref f1(bool f)
14 {
15 if (f)
16 return sx;
17 return sy;
18 }
19
20 ref f2(bool f)
21 {
22 if (f)
23 return sy;
24 return sx;
25 }