Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail21928b.d(18): Error: this array literal causes a GC allocation in `@nogc` function `main`
5 ---
6 */
7
8 @nogc:
9
10
11 struct Shape
12 {
13 immutable size_t[] dims = [];
14 }
15
16 void main()
17 {
18 auto s = Shape(Shape.init.dims ~ 2);
19 }