FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / thunk1.C
blobf2d073e7b77744aeab0d9448d1748be2d47759e1
1 // Test that non-variadic function calls using thunks work right.
3 struct A {
4   void* p;
5   A (void* q): p (q) { }
6   A (const A& a): p (a.p) { }
7 };
9 class CBase {
10 public:
11   virtual void BaseFunc();
14 class MMixin {
15 public:
16    virtual A MixinFunc(int arg, A arg2) = 0;
19 class CExample : public CBase, public MMixin {
20 public:
21    A MixinFunc(int arg, A arg2);
24 void CBase::BaseFunc()
28 A CExample::MixinFunc(int arg, A arg2)
30   if (arg != 1 || arg2.p != 0)
31     return 0;
32   return this;
35 void* test(MMixin& anExample)
37   return anExample.MixinFunc(1,A(0)).p;
40 int main ()
42   CExample c;
44   if (test(c) != &c)
45     return 1;