Merge from mainline
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / bool2.C
blob3d8bc3c03ebd382c9fa58cdec56613d28fbdf585
1 // { dg-do run  }
2 // { dg-options "" }
3 class A {
4 public:
5   operator bool () {
6     return true;
7   }
8 } a;
9 class A1 {
10 public:
11   operator int () {
12     return true;
13   }
14 } a1;
15 class A2 {
16 public:
17   operator const char * () {
18     return "";
19   }
20 } a2;
21 class A3 {
22 public:
23   operator unsigned long long int () {
24     return true;
25   }
26 } a3;
27 class A4 {
28 public:
29   operator const char * () {
30     return "";
31   }
32   operator unsigned long long int () {
33     return true;
34   }
35 } a4;
36 class A5 {
37 public:
38   operator double () {
39     return 256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0
40       *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0
41         *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0
42           *256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0*256.0e0;
43   }
44 } a5;
45 int i = true;
46 bool b = true;
47 bool c = (bool)(void (A::*)())0;
48 bool d = 256;
49 main() {
50   if (!d) return 1;
51   if (!a) return 1;
52   if (!(bool)a) return 1;
53   //  if (!(long long)a) return 1;
54   if (!a1) return 1;
55   if (!a2) return 1;
56   if (!a3) return 1;
57   if (!a5) return 1;