2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / casts2.C
blobe1f4359972b21ae84f962683091d73a429154813
1 // { dg-do assemble  }
2 // GROUPS passed casts
3 class VObject;
5 typedef int boolean;
7 typedef boolean (VObject::*method)();
8 typedef boolean (VObject::*method0)();
9 typedef boolean (VObject::*method1)(long);
11 #define methodOf(o,m)  (method)(&o::m)
14 class VObject {
15     public:
16     boolean perform(method );
17     boolean perform(method , long);
18     void    affectMethod(method );
19     void    dummy(){};
23 boolean VObject::perform(method m)
25         method0 q = (method0)m;
26         return(this->*q)();
30 boolean VObject::perform(method m, long param)
32         method1 q = (method1)m;
33         return(this->*q)(param);
34  }
36 void VObject::affectMethod(method m)
38         m =   methodOf(VObject, dummy);