MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag9358.d
blob58dd495ab8eb9299b32459a78e0068d07971fa5e
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag9358.d(13): Error: `x` must be of integral or string type, it is a `double`
5 fail_compilation/diag9358.d(15): Error: `case` expression must be a compile-time `string` or an integral constant, not `1.1`
6 fail_compilation/diag9358.d(16): Error: `case` expression must be a compile-time `string` or an integral constant, not `2.1`
7 fail_compilation/diag9358.d(26): Error: `case` expression must be a compile-time `string` or an integral constant, not `z`
8 ---
9 */
10 void main()
12 double x;
13 switch (x)
15 case 1.1: break;
16 case 2.1: break;
17 default:
21 void f(immutable string y)
23 auto z = y[0..2];
24 switch (y)
26 case z: break;
27 default: