summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/thunk1.C
blob: 35243f529838199976e365d9e92a0dcb347d616f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// { dg-do run  }
extern "C" void abort();

int ic;

struct X 
{
  X() { ++ic; }
  X( const X & ) { ++ic; }
 ~X() { if (--ic < 0) abort(); }
};

struct V 
{
  virtual ~V() {}
};

struct A : public virtual V 
{
}; 

struct B : public virtual V 
{
  virtual void foo( X ) = 0;
}; 

struct D : public A, public virtual B 
{
  virtual void foo( X ) {}
}; 

int main()
{
  B *b = new D;
  b->foo( X() );
}