Debian Codegraph @

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

raw
1 // REQUIRED_ARGS: -m32
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/diag9250.d(19): Error: cannot implicitly convert expression `10u` of type `uint` to `Foo`
6 fail_compilation/diag9250.d(22): Error: cannot implicitly convert expression `10u` of type `uint` to `void*`
7 ---
8 */
9
10 struct Foo
11 {
12 ubyte u;
13 }
14
15 void main()
16 {
17 uint[10] bar;
18
19 Foo x = bar.length; // error here
20
21 void* y = bar.length ?
22 bar.length : // error here
23 bar.length;
24 }