]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail13336b.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail13336b.d
1 // REQUIRED_ARGS: -o-
2 // PERMUTE_ARGS:
3
4 int sx;
5 double sy;
6
7 /*
8 TEST_OUTPUT:
9 ---
10 fail_compilation/fail13336b.d(16): Error: cast(double)sx is not an lvalue
11 ---
12 */
13 ref f1(bool f)
14 {
15 if (f)
16 return sx;
17 return sy;
18 }
19
20 /*
21 TEST_OUTPUT:
22 ---
23 fail_compilation/fail13336b.d(30): Error: cast(double)sx is not an lvalue
24 ---
25 */
26 ref f2(bool f)
27 {
28 if (f)
29 return sy;
30 return sx;
31 }