gcc/testsuite/gdc.dg/Wcastresult2.d
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "-Wcast-result -Wno-deprecated" } |
| 3 | |
| 4 | void test() |
| 5 | { |
| 6 | auto imvalue = 1.23i; |
| 7 | auto revalue = 1.23; |
| 8 | |
| 9 | auto imtore = cast(double)imvalue; // { dg-warning "cast from 'idouble' to 'double' will produce zero result" } |
| 10 | auto retoim = cast(idouble)revalue; // { dg-warning "cast from 'double' to 'idouble' will produce zero result" } |
| 11 | return; |
| 12 | } |