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