Debian Codegraph @

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

raw
1 /*
2 DISABLED: freebsd32 openbsd32 linux32 osx32 win32
3 TEST_OUTPUT:
4 ---
5 fail_compilation/ice20042.d(18): Error: slice operation `cast(__vector(float[4]))[nanF, nanF, nanF, nanF] = [1.0F, 2.0F, 3.0F, 4.0F][0..4]` cannot be evaluated at compile time
6 fail_compilation/ice20042.d(25): called from here: `Vec4(cast(__vector(float[4]))[nanF, nanF, nanF, nanF]).this([1.0F, 2.0F, 3.0F, 4.0F])`
7 ---
8 */
9 void write(T...)(T t){}
10
11 struct Vec4
12 {
13 __vector(float[4]) raw;
14
15 this(const(float[4]) value...) inout pure @safe nothrow @nogc
16 {
17 __vector(float[4]) raw;
18 raw[] = value[];
19 this.raw = raw;
20 }
21 }
22
23 void main()
24 {
25 static immutable Vec4 v = Vec4( 1.0f, 2.0f, 3.0f, 4.0f );
26
27 static foreach(d; 0 .. 4)
28 write(v.raw[d], " ");
29 }