2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / overload7.C
blob29a90601656822541513a5e79906f04bed44ce36
1 // { dg-do run  }
2 // GROUPS passed overloading
3 extern "C" int printf (const char *, ...);
5 struct NoName {
6         
7         int first;
8         int second;
9 };
11 class Casted {
13   public:
15         NoName  x;
16         double  y;
18         Casted ( int _x , double _y ): y(_y) 
19         { 
20                 x.first = _x;
21                 x.second = _x*2;
22         }
23         
24         operator NoName() const { return x; }
25         operator double() const { return y; }
28 int main()
30         Casted c(10,12.34);
32         NoName x;
33         double y;
35         x = c;
36         y = c;
38         if (x.first == 10 && x.second == 20 && y == 12.34)
39           printf ("PASS\n");
40         else
41           { printf ("FAIL\n"); return 1; }