MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / b3841.d
blob0dda8bdd3a4c71057f4f5f183b6eab14e9a19543
1 // REQUIRED_ARGS: -w -o-
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/b3841.d-mixin-32(32): Warning: `char += float` is performing truncating conversion
7 fail_compilation/b3841.d-mixin-32(32): Warning: `int += float` is performing truncating conversion
8 fail_compilation/b3841.d-mixin-32(32): Warning: `long += double` is performing truncating conversion
9 fail_compilation/b3841.d-mixin-32(32): Warning: `char -= float` is performing truncating conversion
10 fail_compilation/b3841.d-mixin-32(32): Warning: `int -= float` is performing truncating conversion
11 fail_compilation/b3841.d-mixin-32(32): Warning: `long -= double` is performing truncating conversion
12 fail_compilation/b3841.d-mixin-32(32): Warning: `char *= float` is performing truncating conversion
13 fail_compilation/b3841.d-mixin-32(32): Warning: `int *= float` is performing truncating conversion
14 fail_compilation/b3841.d-mixin-32(32): Warning: `long *= double` is performing truncating conversion
15 fail_compilation/b3841.d-mixin-32(32): Warning: `char /= float` is performing truncating conversion
16 fail_compilation/b3841.d-mixin-32(32): Warning: `int /= float` is performing truncating conversion
17 fail_compilation/b3841.d-mixin-32(32): Warning: `long /= double` is performing truncating conversion
18 fail_compilation/b3841.d-mixin-32(32): Warning: `char %= float` is performing truncating conversion
19 fail_compilation/b3841.d-mixin-32(32): Warning: `int %= float` is performing truncating conversion
20 fail_compilation/b3841.d-mixin-32(32): Warning: `long %= double` is performing truncating conversion
21 Error: warnings are treated as errors
22 Use -wi if you wish to treat warnings only as informational.
23 ---
27 void f(string op, LHS, RHS)()
29 // pragma(msg, LHS, " += ", RHS);
30 LHS a;
31 RHS b;
32 mixin("a "~op~" b;");
35 template Ops(T...)
37 alias Ops = T;
40 void main()
42 foreach (string op; Ops!("+=", "-=", "*=", "/=", "%="))
44 // OK
45 f!(op, int, int)();
46 f!(op, long, int)();
47 f!(op, long, short)();
48 f!(op, float, long)();
49 f!(op, double, float)();
51 // Should that really be OK ?
52 f!(op, short, int)();
53 f!(op, float, double)();
55 // Not OK, truncating conversion.
56 f!(op, char, float)();
57 f!(op, int, float)();
58 f!(op, long, double)();
61 // OK
62 f!("^^=", int, int)();
63 f!("^^=", long, int)();
64 f!("^^=", long, short)();
65 f!("^^=", float, long)();
66 f!("^^=", double, float)();
67 // Should that really be OK ?
68 f!("^^=", float, double)();