PR c++/80290
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / casts2.C
blobcba10f2807e6ecf24baeec93e359cc9c8164ca61
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);