Debian Codegraph @

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

raw
1 /* REQUIRED_ARGS: -betterC
2 TEST_OUTPUT:
3 ---
4 fail_compilation/test23710.d(111): Error: array concatenation of expression `foo ~ [1, 2, 3]` requires the GC which is not available with -betterC
5 ---
6 */
7 // https://issues.dlang.org/show_bug.cgi?id=23710
8
9 #line 100
10
11 int test(int i)
12 {
13 int j;
14 int[] foo;
15 if (0)
16 {
17 for (;;)
18 {
19 import core.stdc.stdio;
20 printf("start body\n");
21 foo = foo ~ [1,2,3];
22 L1:
23 printf("foo.length = %zu\n", foo.length);
24 j += foo.length;
25 i += 2;
26 if (i > 5)
27 return j;
28 printf("end body\n");
29 }
30 }
31 goto L1;
32 }