2 // { dg-options "-Wconversion" }
3 // Copyright (C) 2000 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 24 Feb 2000 <nathan@codesourcery.com>
6 // derived from a bug report by Johan Kuipers <j.kuipers@chello.nl>
7 // initialization to 'int' from to 'double' We expect consistent warnings
8 // whenever a float is implicitly truncated to int
18 void wibble (int, int);
19 void punk (int = 3.5);
21 void rock (int, int = 3.5);
25 X x1(3.5); // { dg-warning "" } double to int
26 X x2(3.5f); // { dg-warning "" } float to int
27 X x3(1, 3.5); // { dg-warning "" } double to int
28 X x4(1, 3.5f); // { dg-warning "" } float to int
29 X x5(3.5, 1); // { dg-warning "" } double to int
30 X x6(3.5f, 1); // { dg-warning "" } float to int
32 X y1 = 3.5; // { dg-warning "" } double to int
33 X y2 = 3.5f; // { dg-warning "" } float to int
35 int j1 (3.5); // { dg-warning "" } double to int
36 int j2 (3.5f); // { dg-warning "" } float to int
38 int k1 = 3.5; // { dg-warning "" } double to int
39 int k2 = 3.5f; // { dg-warning "" } float to int
41 j1 = 3.5; // { dg-warning "" } double to int
42 j2 = 3.5f; // { dg-warning "" } float to int
44 foo (3.5); // { dg-warning "" } double to int
45 foo (3.5f); // { dg-warning "" } float to int
47 wibble (3.5); // { dg-warning "" } double to int
48 wibble (3.5f); // { dg-warning "" } float to int
49 wibble (1, 3.5); // { dg-warning "" } double to int
50 wibble (1, 3.5f); // { dg-warning "" } float to int
51 wibble (3.5, 1); // { dg-warning "" } double to int
52 wibble (3.5f, 1); // { dg-warning "" } float to int
54 punk (); // { dg-warning "" } double to int
55 rock (1); // { dg-warning "" } double to int